/* Country Modal Styles */

.country-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.country-modal.active {
    opacity: 1;
    pointer-events: all;
}

/* Backdrop - Modern Glass Effect */
.country-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Modal Content Container - Glass Morphism */
.country-modal-content {
    position: relative;
    width: calc(100% - 80px);
    max-width: 1360px;
    max-height: 90vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 32px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 
        0 24px 48px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    scroll-behavior: smooth;
}

/* Scrollbar styling - Modern */
.country-modal-content::-webkit-scrollbar {
    width: 6px;
}

.country-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.country-modal-content::-webkit-scrollbar-thumb {
    background: rgba(104, 110, 238, 0.2);
    border-radius: 10px;
    transition: background 0.2s ease;
}

.country-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(104, 110, 238, 0.4);
}

[data-theme="dark"] .country-modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .country-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.country-modal.active .country-modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

[data-theme="dark"] .country-modal-content {
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 24px 48px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

/* Close Button - Modern Glass */
.country-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.country-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .country-modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .country-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.country-modal-close svg {
    width: 24px;
    height: 24px;
}

/* Hero Section - Modern Rounded Top */
.country-modal-hero {
    position: relative;
    width: 100%;
    min-height: 300px;
    max-height: 300px;
    height: 300px;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 32px 32px 0 0;
}

.country-modal-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.country-modal-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, 
        rgba(0, 0, 0, 0.85) 0%, 
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.2) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 32px 48px;
}

.country-modal-hero-overlay h1 {
    font-size: 48px;
    font-weight: 900;
    color: white;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.country-modal-hero-overlay p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.95);
    max-width: 700px;
    line-height: 1.6;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Modal Body */
.country-modal-body {
    flex: 1;
    padding: 40px 60px 48px;
}

/* Two column layout wrapper */
.country-modal-content-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    align-items: start;
    margin-bottom: 40px;
}

.country-modal-header {
    text-align: center;
    margin-bottom: 32px;
    grid-column: 1 / -1; /* Span full width */
}

.country-modal-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.country-modal-header p {
    font-size: 15px;
    color: var(--color-text-secondary);
}

/* Services List */
.country-services-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Country Info Sidebar */
.country-info-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.country-info-card {
    background: rgba(104, 110, 238, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(104, 110, 238, 0.12);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(104, 110, 238, 0.04);
}

[data-theme="dark"] .country-info-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.country-info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(104, 110, 238, 0.16);
    border-color: rgba(104, 110, 238, 0.2);
}

[data-theme="dark"] .country-info-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
}

.country-info-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: white;
    font-size: 22px;
    box-shadow: 0 6px 16px rgba(104, 110, 238, 0.3);
}

.country-info-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.country-info-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: 3px;
}

.country-info-description {
    font-size: 12px;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

/* Service Card - Modern Glass */
.country-service-card {
    background: rgba(104, 110, 238, 0.04);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(104, 110, 238, 0.1);
    border-radius: 16px;
    padding: 18px 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(104, 110, 238, 0.03);
}

.country-service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(104, 110, 238, 0.12);
    border-color: rgba(104, 110, 238, 0.2);
    background: rgba(104, 110, 238, 0.06);
}

[data-theme="dark"] .country-service-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .country-service-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.service-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
}

.service-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 12px;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(104, 110, 238, 0.3);
}

.service-card-header h3 {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.3;
}

.service-description {
    font-size: 12px;
    line-height: 1.5;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    margin-left: 38px; /* Align with title after number badge */
}

.service-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-left: 38px; /* Align with description */
}

.service-price {
    font-size: 18px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.service-order-btn {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Modal Footer - Modern */
.country-modal-footer {
    text-align: center;
    padding-top: 32px;
    margin-top: 24px;
    border-top: 1px solid rgba(104, 110, 238, 0.1);
}

[data-theme="dark"] .country-modal-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.country-modal-footer p {
    font-size: 15px;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
}

.country-modal-cta {
    display: flex;
    justify-content: center;
}

.modal-cta-btn {
    padding: 14px 40px;
    font-size: 15px;
}

/* Other Countries Section - Modern with Enhanced Scrolling */
.other-countries-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid rgba(104, 110, 238, 0.1);
    overflow: visible;
}

[data-theme="dark"] .other-countries-section {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.other-countries-header {
    text-align: center;
    margin-bottom: 24px;
}

.other-countries-header h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.other-countries-header p {
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* Scrollable container wrapper for better touchpad experience */
.other-countries-scroll-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    /* Smooth momentum scrolling for touchpad/trackpad */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Padding for visual breathing room */
    padding: 8px 0 16px 0;
    /* Cursor hint */
    cursor: grab;
}

.other-countries-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.other-countries-scroll-wrapper:active {
    cursor: grabbing;
}

.other-countries-grid {
    display: flex;
    gap: 20px;
    width: fit-content;
    /* Remove animation for desktop - manual scroll is better */
    animation: none;
}

/* Optional: Add subtle scroll snap for better card alignment */
.other-countries-scroll-wrapper {
    scroll-snap-type: x proximity;
}

.other-country-card {
    scroll-snap-align: start;
}

/* Keep animation for mobile where auto-scroll works better */
@media (max-width: 968px) {
    .other-countries-scroll-wrapper {
        overflow: hidden;
        cursor: default;
    }
    
    .other-countries-grid {
        animation: scrollCountries 50s linear infinite;
    }
    
    .other-countries-grid:hover {
        animation-play-state: paused;
    }
}

@keyframes scrollCountries {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.other-country-card {
    position: relative;
    width: 200px;
    height: 280px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* Ensure proper stacking to prevent text bleed-through */
    isolation: isolate;
    z-index: 1;
}

.other-country-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 48px rgba(104, 110, 238, 0.2);
    border-color: rgba(104, 110, 238, 0.4);
    z-index: 2;
}

.other-country-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Prevent image bleed-through */
    position: relative;
    z-index: 0;
}

.other-country-card:hover img {
    transform: scale(1.05);
}

.other-country-overlay {
    position: absolute;
    inset: 0;
    /* Stronger gradient for better text visibility and isolation */
    background: linear-gradient(to top, 
        rgba(0, 0, 0, 0.95) 0%, 
        rgba(0, 0, 0, 0.6) 40%,
        rgba(0, 0, 0, 0.2) 70%,
        rgba(0, 0, 0, 0) 100%);
    display: flex;
    align-items: flex-end;
    padding: 20px;
    transition: background 0.4s ease;
    /* Ensure overlay is above image */
    z-index: 1;
}

.other-country-card:hover .other-country-overlay {
    background: linear-gradient(to top, 
        rgba(0, 0, 0, 0.9) 0%, 
        rgba(0, 0, 0, 0.5) 40%,
        rgba(0, 0, 0, 0.2) 70%,
        rgba(0, 0, 0, 0) 100%);
}

.other-country-name {
    font-size: 20px;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    /* Ensure text is on top */
    position: relative;
    z-index: 2;
}

/* Country Modal FAQ Section - Matching General FAQ Design */
.country-modal-faq-section {
    margin-top: 48px;
}

.modal-faq-category {
    background: rgba(104, 110, 238, 0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(104, 110, 238, 0.1);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(104, 110, 238, 0.06);
    transition: all 0.3s ease;
    margin-top: 24px;
}

[data-theme="dark"] .modal-faq-category {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.modal-faq-category:hover {
    box-shadow: 0 8px 24px rgba(104, 110, 238, 0.1);
}

[data-theme="dark"] .modal-faq-category:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.modal-faq-list {
    display: flex;
    flex-direction: column;
}

.modal-faq-item {
    border-bottom: 1px solid var(--glass-border);
}

.modal-faq-item:last-child {
    border-bottom: none;
}

.modal-faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: var(--font-lg); /* 18px - matches visa titles and general FAQ */
    font-weight: 600;
    color: var(--color-text-primary);
    transition: all 0.3s ease;
    gap: 16px;
}

.modal-faq-question:hover {
    color: var(--color-primary);
    padding-left: 4px;
}

.modal-faq-question span {
    flex: 1;
}

.modal-faq-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--color-primary);
}

.modal-faq-item.active .modal-faq-icon {
    transform: rotate(180deg);
}

.modal-faq-answer {
    height: 0;
    overflow: hidden;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-faq-item.active .modal-faq-answer {
    padding-bottom: 20px;
}

.modal-faq-answer p {
    color: var(--color-text-secondary);
    line-height: 1.7;
    font-size: var(--font-base); /* 15px - matches visa descriptions and general FAQ */
    margin: 0;
}

/* Responsive Design */
@media (max-width: 968px) {
    .country-modal-content-wrapper {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .country-info-sidebar {
        order: -1; /* Show above services on tablet */
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .other-countries-grid {
        gap: 16px;
        animation: scrollCountries 50s linear infinite;
    }
    
    .other-country-card {
        width: 160px;
        height: 240px;
    }
    
    .other-country-overlay {
        padding: 16px;
    }
    
    .other-country-name {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .country-modal-content {
        width: calc(100% - 32px);
        max-height: 95vh;
        border-radius: 20px;
    }

    .country-modal-close {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }

    .country-modal-close svg {
        width: 20px;
        height: 20px;
    }

    .country-modal-hero {
        min-height: 240px;
        max-height: 240px;
        height: 240px;
    }

    .country-modal-hero-overlay {
        padding: 20px;
    }

    .country-modal-hero-overlay h1 {
        font-size: 28px;
        letter-spacing: 1px;
    }

    .country-modal-hero-overlay p {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }

    .country-modal-body {
        padding: 24px;
    }

    .country-modal-header h2 {
        font-size: 22px;
    }

    .country-modal-header p {
        font-size: 13px;
    }
    
    /* Hide country info sidebar on mobile */
    .country-info-sidebar {
        display: none !important;
    }
    
    /* Make services full width on mobile */
    .country-modal-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    /* Adjust other countries cards for mobile - 3 per viewport */
    .other-countries-grid {
        gap: 12px;
        animation: scrollCountries 40s linear infinite; /* 2x slower */
    }
    
    .other-country-card {
        width: 110px; /* Slimmer to fit 3 in view */
        height: 180px;
        /* Stronger isolation on mobile to prevent text overlap */
        isolation: isolate;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        transform: translateZ(0);
    }
    
    .other-country-overlay {
        padding: 12px;
        /* Stronger gradient on mobile for better text isolation */
        background: linear-gradient(to top, 
            rgba(0, 0, 0, 1) 0%, 
            rgba(0, 0, 0, 0.8) 35%,
            rgba(0, 0, 0, 0.3) 65%,
            rgba(0, 0, 0, 0) 100%) !important;
    }
    
    .other-country-name {
        font-size: 14px;
        /* Stronger text shadow on mobile */
        text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.6);
    }
}

    .country-service-card {
        padding: 16px; /* Reduced from 20px */
    }

    .service-card-header {
        gap: 10px; /* Reduced from 12px */
    }

    .service-number {
        width: 32px; /* Reduced from 36px */
        height: 32px; /* Reduced from 36px */
        font-size: 15px; /* Reduced from 16px */
    }

    .service-card-header h3 {
        font-size: 16px; /* Reduced from 18px */
    }

    .service-description {
        font-size: 13px; /* Reduced from 14px */
        margin-left: 42px; /* Adjusted for smaller badge (32px + 10px gap) */
    }

    .service-price-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px; /* Reduced from 16px */
        margin-left: 42px;
    }

    .service-price {
        font-size: 22px; /* Reduced from 24px */
    }

    .service-order-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .country-modal-content {
        width: calc(100% - 24px);
        border-radius: 16px;
    }

    .country-modal-hero {
        min-height: 220px;
        max-height: 220px;
        height: 220px;
    }

    .country-modal-hero-overlay {
        padding: 20px 18px;
    }

    .country-modal-hero-overlay h1 {
        font-size: 24px;
        margin-bottom: 10px;
        letter-spacing: 1px;
    }

    .country-modal-hero-overlay p {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }

    .country-modal-body {
        padding: 24px 20px;
    }

    .country-modal-header {
        margin-bottom: 24px;
    }

    .country-modal-header h2 {
        font-size: 22px;
    }

    .country-services-list {
        gap: 12px;
    }

    .country-service-card {
        padding: 14px;
    }

    .service-card-header h3 {
        font-size: 15px;
    }

    .service-description {
        font-size: 12px;
        margin-left: 0;
    }

    .service-price-row {
        margin-left: 0;
    }

    .service-price {
        font-size: 20px;
    }
    
    /* Even slimmer cards for smaller phones */
    .other-country-card {
        width: 100px;
        height: 160px;
        /* Extra isolation for smallest screens */
        isolation: isolate;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        transform: translateZ(0);
    }
    
    .other-country-overlay {
        /* Even stronger gradient for smallest screens */
        background: linear-gradient(to top, 
            rgba(0, 0, 0, 1) 0%, 
            rgba(0, 0, 0, 0.85) 30%,
            rgba(0, 0, 0, 0.4) 60%,
            rgba(0, 0, 0, 0) 100%) !important;
    }
    
    .other-country-name {
        font-size: 13px;
        /* Maximum text shadow for smallest screens */
        text-shadow: 0 2px 16px rgba(0, 0, 0, 0.9), 0 0 24px rgba(0, 0, 0, 0.7);
    }
}
