/* assets/cga-styles.css */
/* Crypto International Geo-Arbitrage Calculator - Standardized Styles */

/* Wrapper - matches standardization pattern from other calculators */
.cga-wrapper {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    max-width: 1300px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    box-sizing: border-box;
}

/* Break out of WordPress content container constraints using viewport width */
@media (min-width: 1320px) {
    .cga-wrapper {
        width: min(1300px, calc(100vw - 4rem)) !important;
        max-width: 1300px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* Override common WordPress container constraints */
body .entry-content .cga-wrapper,
body .post-content .cga-wrapper,
body .content .cga-wrapper,
body .wp-block-group .cga-wrapper,
body article .cga-wrapper,
.wp-block-column .cga-wrapper {
    max-width: 1300px !important;
    width: min(1300px, calc(100vw - 4rem)) !important;
}

.cga-calculator-root {
    background: #ffffff;
    border: 2px solid #083141;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}

/* Header */
.cga-header {
    margin-bottom: 1.5rem;
}

.cga-title {
    margin: 0 0 0.3rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #083141;
}

.cga-subtitle {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
    color: #334155;
}

.cga-note {
    margin: 0;
    font-size: 0.8rem;
    color: #64748b;
}

/* Steps */
.cga-step {
    border-top: 2px solid #e5e7eb;
    padding: 2rem 1.5rem;
    margin-top: 2rem;
    background: #fafbfc;
    border-radius: 12px;
    border-left: 4px solid #083141;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.cga-step:first-of-type {
    margin-top: 0;
}

.cga-section-title {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #083141;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.cga-section-intro {
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.6;
}

/* Grid */
.cga-grid {
    display: grid;
    gap: 1.25rem;
}

.cga-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cga-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
    .cga-grid-2,
    .cga-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Fields */
.cga-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cga-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #083141;
}

.cga-input,
.cga-select {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0.4rem 0.55rem;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
    background: #f9fafb;
    color: #111827;
}

.cga-input:focus,
.cga-select:focus {
    outline: 2px solid #083141;
    outline-offset: 0;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(8, 49, 65, 0.15);
}

.cga-input::placeholder {
    color: #9ca3af;
}

.cga-field-note {
    font-size: 0.78rem;
    color: #6b7280;
}

/* Range sliders */
.cga-range {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    background: #e5e7eb;
    outline: none;
    margin-top: 4px;
}

.cga-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #083141;
    cursor: pointer;
    box-shadow: 0 0 0 2px #ffffff;
    border: 2px solid #083141;
}

.cga-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #083141;
    cursor: pointer;
    border: 2px solid #083141;
}

.cga-range-value-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 1.6rem;
    border-radius: 999px;
    background: #ebf2f4;
    font-size: 0.82rem;
    font-weight: 600;
    color: #083141;
    padding: 0 8px;
    margin-left: 6px;
}

/* Pills */
.cga-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.cga-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 0.82rem;
    font-weight: 500;
    color: #4b5563;
    background: #f3f4f6;
}

/* Filter legend */
.cga-filter-legend {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #38bdf8;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
    position: relative;
    overflow: hidden;
}

.cga-filter-legend::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #38bdf8 0%, #0ea5e9 50%, #0284c7 100%);
}

.cga-filter-legend-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #083141;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cga-filter-legend-title::before {
    content: '💡';
    font-size: 1.2rem;
}

.cga-filter-legend ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.75rem;
}

.cga-filter-legend li {
    margin: 0;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    font-size: 0.9rem;
    color: #1e293b;
    line-height: 1.5;
    border-left: 3px solid #38bdf8;
    position: relative;
}

.cga-filter-legend li::before {
    content: '→';
    position: absolute;
    left: 1rem;
    color: #0284c7;
    font-weight: bold;
    line-height: 1.5;
}

.cga-filter-legend li strong {
    color: #083141;
    font-weight: 700;
}

/* Summary Cards */
.cga-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.cga-summary-card {
    border-radius: 12px;
    padding: 1.25rem 1rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
}

.cga-summary-card--highlight {
    background: #eff6ff;
    border-color: #60a5fa;
}

.cga-summary-card--top-match {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
    padding: 1.5rem 1.25rem;
}

.cga-summary-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.cga-summary-card--top-match .cga-summary-label {
    color: #92400e;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

.cga-summary-value {
    font-weight: 700;
    font-size: 1.2rem;
    color: #083141;
    line-height: 1.3;
}

.cga-summary-value--large {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.cga-summary-card--top-match .cga-summary-value {
    color: #92400e;
}

.cga-summary-sub {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.cga-summary-card--top-match .cga-summary-sub {
    color: #78350f;
    font-weight: 500;
}

/* Results */
.cga-results-wrapper {
    margin-top: 1.5rem;
}

.cga-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Charts */
.cga-chart-section {
    margin-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5rem;
    margin-bottom: 0;
}

.cga-chart-title {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #083141;
}

.cga-chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

@media (max-width: 900px) {
    .cga-chart-grid {
        grid-template-columns: 1fr;
    }
}

.cga-chart-wrapper {
    position: relative;
    width: 100%;
    height: 350px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    background: #ffffff;
    box-sizing: border-box;
}

.cga-chart-canvas {
    width: 100%;
    height: 100%;
}

/* Country Cards */
.cga-country-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.cga-country-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    background: #ffffff;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.cga-country-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.cga-country-card--top {
    border-color: #60a5fa;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
}

.cga-country-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.cga-country-card-header > div {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.cga-country-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #083141;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.cga-country-rank--top {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

.cga-country-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #083141;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.cga-country-region {
    font-size: 0.82rem;
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.cga-country-scores {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 0.5rem;
    margin-bottom: 1rem;
}

.cga-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.cga-score-label {
    color: #6b7280;
}

.cga-score-value {
    font-weight: 600;
    color: #083141;
}

.cga-country-expand {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.cga-expand-btn {
    width: 100%;
    padding: 0.5rem;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #083141;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.cga-expand-btn:hover {
    background: #083141;
    color: #ffffff;
}

.cga-country-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    display: none;
}

.cga-country-details--open {
    display: block;
}

.cga-detail-section {
    margin-bottom: 1rem;
}

.cga-detail-section:last-child {
    margin-bottom: 0;
}

.cga-detail-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #083141;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.cga-detail-text {
    font-size: 0.85rem;
    color: #374151;
    line-height: 1.5;
}

.cga-criteria-list {
    margin: 0.5rem 0 0;
    padding-left: 18px;
    font-size: 0.85rem;
    color: #374151;
}

.cga-criteria-list li {
    margin: 0.25rem 0;
}

/* Table (for detailed view) */
.cga-table-container {
    margin-top: 1rem;
}

.cga-table-scroll {
    width: 100%;
    overflow-x: auto;
    margin-top: 1rem;
}

.cga-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 800px;
}

.cga-table th,
.cga-table td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    vertical-align: top;
    text-align: left;
}

.cga-table th {
    background: #ebf2f4;
    font-weight: 600;
    color: #083141;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.cga-table tr:nth-child(even) td {
    background: #f9fafb;
}

.cga-table tbody tr:hover {
    background: #f0f4f8;
}

/* Rating stars */
.cga-rating-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cga-rating-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.cga-rating-label {
    color: #6b7280;
}

.cga-rating-stars {
    color: #fbbf24;
    font-size: 1rem;
    letter-spacing: 2px;
}

/* Empty state */
.cga-empty-state {
    margin-top: 1rem;
    padding: 2rem;
    border-radius: 12px;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    text-align: center;
}

.cga-empty-state strong {
    display: block;
    font-size: 1rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.cga-empty-state p {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
}

/* View Toggle */
.cga-view-toggle-wrapper {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.cga-view-toggle-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cga-view-toggle-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #083141;
    white-space: nowrap;
}

.cga-view-toggle {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cga-view-btn {
    padding: 0.5rem 1rem;
    background: #ffffff;
    border: 2px solid #083141;
    border-radius: 6px;
    color: #083141;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cga-view-btn:hover {
    background: #083141;
    color: #ffffff;
}

.cga-view-btn--active {
    background: #083141;
    color: #ffffff;
}

/* Export / MailerLite CTA (bottom of results) */
.cga-export-wrapper {
    margin-top: 2rem;
    padding: 30px 24px;
    border-top: 3px solid #083141;
    border-radius: 16px;
    text-align: center;
    background: linear-gradient(180deg, rgba(8, 49, 65, 0.08) 0%, rgba(8, 49, 65, 0.02) 100%);
}

.cga-export-cta-title {
    margin: 0 0 0.35rem 0;
    color: #083141;
    font-size: 1.15rem;
    font-weight: 800;
}

.cga-export-cta-sub {
    margin: 0 0 1rem 0;
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.cga-export-btn {
    padding: 0.75rem 2rem;
    background: #083141;
    border: 2px solid #083141;
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cga-export-btn--primary {
    padding: 18px 36px;
    font-size: 18px;
    font-weight: 800;
    min-height: 56px;
    width: 100%;
    max-width: 420px;
    border-radius: 14px;
    border-width: 3px;
    background: linear-gradient(135deg, #083141 0%, #0a4a63 100%);
    box-shadow: 0 6px 20px rgba(8, 49, 65, 0.25);
}

.cga-export-btn:hover {
    background: #0a3d54;
    border-color: #0a3d54;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(8, 49, 65, 0.2);
}

.cga-export-btn--primary:hover {
    background: linear-gradient(135deg, #0a4a63 0%, #062a38 100%);
    border-color: #062a38;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(8, 49, 65, 0.3);
}

/* MailerLite modal */
.cga-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
}

.cga-modal {
    background: #fff;
    border: 3px solid #9333ea;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 540px;
    width: 100%;
    z-index: 1000000;
}

.cga-modal-header {
    padding: 28px;
    background: linear-gradient(135deg, #9333ea, #7e22ce);
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cga-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    color: #fff;
}

.cga-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    line-height: 1;
}

.cga-modal-body {
    padding: 28px;
}

.cga-modal-label {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 10px;
    display: block;
}

.cga-modal-input {
    font-size: 16px;
    padding: 14px 16px;
    border: 3px solid #9333ea;
    width: 100%;
    border-radius: 12px;
    box-sizing: border-box;
}

.cga-modal-trust {
    background: #f3e8ff;
    padding: 16px;
    border-radius: 12px;
    margin-top: 24px;
    font-size: 14px;
}

.cga-modal-footer {
    padding: 24px 28px;
    border-top: 3px solid #e9d5ff;
    display: flex;
    gap: 14px;
    justify-content: flex-end;
    background: #f3e8ff;
    flex-wrap: wrap;
}

.cga-modal-submit {
    min-width: 220px;
    min-height: 48px;
    border: 3px solid #9333ea;
    background: #9333ea;
    color: #fff;
    padding: 16px 32px;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
}

.cga-modal-submit:hover:not(:disabled) {
    background: #7e22ce;
}

.cga-modal-btn-secondary {
    border: 2px solid #e9d5ff;
    background: #fff;
    color: #0f172a;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    min-height: 48px;
}

.cga-modal-error {
    color: #dc2626;
    font-size: 14px;
    margin-top: 8px;
}

.cga-modal-success {
    font-size: 18px;
    font-weight: 700;
    color: #059669;
    text-align: center;
    padding: 24px;
}

@media (max-width: 540px) {
    .cga-modal {
        max-width: 100%;
        margin: 0 8px;
    }

    .cga-modal-footer {
        flex-direction: column;
    }

    .cga-modal-submit,
    .cga-modal-btn-secondary {
        min-width: 100%;
    }
}

/* Comparison View */
.cga-comparison-container {
    margin-top: 1.5rem;
}

.cga-comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.cga-comparison-card {
    border: 2px solid #083141;
    border-radius: 12px;
    padding: 1.25rem;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.cga-comparison-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #083141;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.cga-comparison-card-region {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.cga-comparison-card-content {
    display: grid;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.cga-comparison-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cga-comparison-row--highlight {
    background: #ecfdf3;
    padding: 0.5rem;
    border-radius: 6px;
    margin-top: 0.5rem;
}

.cga-comparison-row--highlight span:first-child,
.cga-comparison-row--highlight span:last-child {
    font-weight: 700;
    color: #166534;
}

.cga-comparison-row--subtle {
    background: #f9fafb;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.cga-comparison-visa-box {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #fef3c7;
    border-radius: 6px;
    font-size: 0.85rem;
}

.cga-comparison-visa-title {
    display: block;
    margin-bottom: 0.5rem;
    color: #92400e;
    font-weight: 700;
    font-size: 0.85rem;
}

.cga-comparison-visa-list {
    line-height: 1.6;
}

.cga-comparison-visa-item {
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.cga-comparison-visa-item:last-child {
    margin-bottom: 0;
}

/* Print styles */
@media print {
    .cga-wrapper {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .cga-calculator-root {
        box-shadow: none;
        border-radius: 0;
        border: none;
        padding: 0;
    }
    
    .cga-step {
        page-break-inside: avoid;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }
    
    .cga-view-toggle-wrapper,
    .cga-view-toggle,
    .cga-export-wrapper,
    .cga-export-btn,
    .cga-modal-overlay,
    .cga-expand-btn,
    button {
        display: none !important;
    }
    
    .cga-country-details {
        display: block !important;
    }
    
    .cga-chart-section {
        page-break-inside: avoid;
    }
}

/* Disclaimer */
.cga-disclaimer {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: rgba(220, 53, 69, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.cga-disclaimer strong {
    color: #b91c1c;
}

.cga-disclaimer-text {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #721c24;
}

/* Loading state */
.cga-loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

/* Accessibility */
.cga-input::-webkit-outer-spin-button,
.cga-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cga-input[type="number"] {
    -moz-appearance: textfield;
}

