/*
Theme Name: VisaPro Immigration
Theme URI: https://example.com/visapro
Author: VisaPro Team
Description: A modern Glassmorphism theme for Visa & Immigration services.
Version: 2.1 (Mobile Width Fix)
License: GNU General Public License v2 or later
Text Domain: visapro
*/

:root {
    --bg-color: #0f172a; /* Slate 900 */
    --bg-gradient: radial-gradient(circle at top left, #1e293b, #0f172a);
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary: #3b82f6; /* Blue 500 */
    --primary-hover: #2563eb;
    --accent: #f59e0b; /* Amber 500 */
    --success: #10b981; /* Emerald 500 */
    --text-light: #f8fafc;
    --text-dim: #94a3b8;
    --blur: 16px;
    --header-height: 80px;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* CRITICAL: Stops horizontal sliding */
    width: 100%;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; }

body {
    background-color: var(--bg-color);
    background-image: var(--bg-gradient);
    color: var(--text-light);
    line-height: 1.7;
    overflow-x: hidden; /* CRITICAL: Double protection against scroll */
    width: 100%;
    padding-top: var(--header-height);
    position: relative;
}

/* --- Typography --- */
h1, h2, h3, h4 { color: #ffffff; line-height: 1.2; font-weight: 700; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
p { margin-bottom: 15px; }

.text-gradient {
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Layout Utilities --- */
.container { 
    max-width: 1280px; 
    margin: 0 auto; 
    padding: 0 24px; 
    width: 100%; /* Ensure it doesn't exceed screen */
}
.section-padding { padding: 100px 0; }

/* --- Background Effects --- */
.glow-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.4;
    animation: float 15s infinite alternate;
    pointer-events: none; /* Prevent interaction causing scroll */
}
.blob-1 { width: 500px; height: 500px; background: var(--primary); top: -100px; left: -100px; }
.blob-2 { width: 400px; height: 400px; background: #8b5cf6; bottom: 10%; right: -50px; animation-delay: -5s; }
.blob-3 { width: 300px; height: 300px; background: var(--accent); top: 40%; left: 30%; opacity: 0.15; }

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(30px, 50px) rotate(10deg); }
}

/* --- Glass Card Utility --- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-radius: 24px;
    overflow: hidden;
    transition: 0.3s;
}
.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* --- Header & Navigation (Responsive Fixes) --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    transition: 0.3s;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(15, 23, 42, 0.95); /* Higher opacity for mobile readability */
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    white-space: nowrap;
    flex-shrink: 1; /* Allow shrinking if needed */
}
.logo i { color: var(--primary); }

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-links li { margin: 0; }
.nav-links a {
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.95rem;
}
.nav-links a:hover { color: white; }

/* Header Button */
.btn-primary {
    background: var(--primary);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: 0.3s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-align: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0; /* Never shrink the button */
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
}

/* Large Block Button */
.btn-block-lg {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #2563eb);
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
}

/* --- Hero Section --- */
.hero {
    padding: 60px 0;
    text-align: center;
    position: relative;
    width: 100%;
    overflow: hidden; /* Keep blobs contained */
}
.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -1px;
    word-wrap: break-word; /* Prevent long text overflow */
}
.hero p {
    font-size: 1.2rem;
    color: var(--text-dim);
    max-width: 700px;
    margin: 0 auto 40px;
}

.hero-images {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 60px;
    perspective: 1000px;
}
.hero-img-card {
    width: 200px; height: 280px;
    border-radius: 20px;
    object-fit: cover;
    border: 4px solid rgba(255,255,255,0.1);
    transform: rotateY(-15deg) translateZ(0);
    transition: 0.5s;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.hero-img-card:nth-child(2) { transform: translateY(-30px); z-index: 10; }
.hero-img-card:nth-child(3) { transform: rotateY(15deg) translateZ(0); }
.hero-images:hover .hero-img-card { transform: rotateY(0) translateY(0); }

/* --- Stats Bar --- */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 60px;
    text-align: center;
    background: rgba(255,255,255,0.03);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}
.stat-number { font-size: 2.5rem; font-weight: 700; color: white; display: block; }
.stat-label { color: var(--text-dim); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; }

/* --- General Grid System --- */
.destination-grid, .features-grid, .review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
    width: 100%;
}

/* --- Cards --- */
.country-card { position: relative; height: 400px; border-radius: 24px; overflow: hidden; }
.country-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.country-card:hover .country-img { transform: scale(1.1); }
.country-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 30px;
    background: linear-gradient(to top, #0f172a 10%, transparent); z-index: 2;
}
.country-badge {
    position: absolute; top: 20px; right: 20px;
    background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(4px);
    padding: 8px 16px; border-radius: 30px;
    font-size: 0.8rem; color: var(--accent); border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Review Card */
.review-card { padding: 30px; }
.client-info { display: flex; align-items: center; gap: 15px; margin-top: 25px; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 20px; }
.client-img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }

/* About Split */
.split-section { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-img-wrapper { position: relative; }
.about-img { width: 100%; border-radius: 30px; border: 1px solid var(--glass-border); }
.experience-badge {
    position: absolute; bottom: -20px; right: -20px; background: var(--bg-color);
    border: 1px solid var(--glass-border); padding: 20px 30px; border-radius: 20px;
    display: flex; align-items: center; gap: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.badge-num { font-size: 2.5rem; font-weight: 800; color: var(--primary); }

/* --- FAQ --- */
.faq-container { max-width: 800px; margin: 50px auto 0; width: 100%; }
.faq-item { border-bottom: 1px solid rgba(255,255,255,0.05); margin-bottom: 10px; }
.faq-question {
    width: 100%; background: transparent; border: none; padding: 25px 10px;
    text-align: left; color: white; font-size: 1.1rem; font-weight: 600;
    cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; color: var(--text-dim); padding: 0 10px; }
.faq-item.active .faq-answer { padding-bottom: 25px; max-height: 200px; }
.faq-item.active .faq-question i { transform: rotate(180deg); color: var(--primary); }

/* --- Forms --- */
.cta-section {
    background: linear-gradient(rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.9)), url('https://images.unsplash.com/photo-1436491865332-7a61a109cc05?auto=format&fit=crop&q=80&w=2074');
    background-size: cover; background-attachment: fixed; padding: 120px 0; text-align: center;
}
.form-box { max-width: 600px; margin: 40px auto 0; padding: 40px; text-align: left; }
.input-group { margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 8px; font-size: 0.9rem; color: var(--text-dim); }
.input-field {
    width: 100%; background: rgba(15, 23, 42, 0.6); border: 1px solid var(--glass-border);
    padding: 15px; border-radius: 12px; color: white; outline: none; transition: 0.3s;
}
.input-field:focus { border-color: var(--primary); background: rgba(15, 23, 42, 0.9); }

/* --- Modal System (Pure Responsive) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(12px); z-index: 2000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

/* Initial Search Modal Card */
.modal-card {
    width: 90%; 
    max-width: 500px; 
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1); 
    border-radius: 24px;
    position: relative; 
    transform: scale(0.95); 
    transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); 
    display: flex; 
    flex-direction: column; 
    overflow: hidden;
}
.modal-overlay.active .modal-card { transform: scale(1); }

/* Search Elements */
.search-content-wrapper { padding: 40px; text-align: center; }
.search-icon-visual {
    width: 70px; height: 70px; background: rgba(59, 130, 246, 0.1);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px; color: var(--primary); font-size: 2rem;
}
.search-title { font-size: 1.5rem; margin-bottom: 10px; color: white; }
.search-desc { color: var(--text-dim); margin-bottom: 25px; font-size: 0.9rem; }

/* Modern Input */
.modern-input-group { position: relative; margin-bottom: 20px; text-align: left; }
.modern-input-group label { 
    display: block; margin-bottom: 8px; font-size: 0.75rem; 
    color: var(--text-light); font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
}
.input-wrapper-icon i {
    position: absolute; left: 16px; top: 70%; transform: translateY(-50%);
    color: var(--text-dim); font-size: 1.1rem;
}
.modern-input {
    width: 100%; background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border);
    padding: 14px 14px 14px 48px; border-radius: 12px; color: white;
    font-size: 1.1rem; outline: none; transition: 0.3s;
}
.modern-input:focus { border-color: var(--primary); background: rgba(0,0,0,0.5); }

/* Expanded Modal (Results) */
.modal-card.modal-expanded {
    max-width: 1100px;
    width: 95%;
    height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
}

.modal-inner-padding { 
    padding: 40px; 
    overflow-y: auto; 
    height: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(255,255,255,0.05);
    -webkit-overflow-scrolling: touch; 
    overscroll-behavior: contain; 
}

.close-modal {
    position: absolute; top: 20px; right: 20px; 
    background: rgba(255,255,255,0.1); backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-light); width: 40px; height: 40px;
    border-radius: 12px; font-size: 1.2rem; cursor: pointer; transition: 0.3s;
    display: flex; align-items: center; justify-content: center; z-index: 50;
}
.close-modal:hover { background: var(--primary); color: white; transform: rotate(90deg); }

/* --- Result View --- */
.result-view { display: none; width: 100%; }
.result-view.active { display: block; }

/* Result Header */
.result-header-grid {
    display: grid; grid-template-columns: 1fr auto; gap: 20px;
    align-items: flex-end; padding-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 30px;
}
.applicant-meta h3 {
    font-size: 2.2rem; margin-bottom: 8px; line-height: 1;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.meta-row { display: flex; gap: 20px; color: var(--text-dim); font-size: 0.95rem; }
.meta-item b { color: #f8fafc; font-weight: 600; margin-left: 5px; }

/* Status Badges */
.status-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 25px; border-radius: 12px;
    font-weight: 700; font-size: 1rem; text-transform: uppercase; letter-spacing: 1px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.status-approved { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-pending { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.status-rejected { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* --- Document Viewer (Full) --- */
.doc-section-title {
    font-size: 1.1rem; color: var(--text-light); margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px; font-weight: 600;
}
.doc-stack-wrapper { display: flex; flex-direction: column; gap: 40px; }
.doc-full-container {
    background: rgba(255,255,255,0.02); border: 1px solid var(--glass-border);
    border-radius: 16px; overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.doc-header-bar {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(15, 23, 42, 0.9); border-bottom: 1px solid var(--glass-border);
    padding: 15px 25px;
}
.doc-title { font-weight: 600; color: white; display: flex; align-items: center; gap: 10px; }
.doc-view-box { position: relative; width: 100%; background: #cbd5e1; height: 75vh; min-height: 500px; }
.doc-iframe { width: 100%; height: 100%; border: none; display: block; }

.download-link-sm {
    background: var(--primary); color: white;
    padding: 8px 20px; border-radius: 8px; font-size: 0.9rem; font-weight: 600;
    text-decoration: none; transition: 0.3s; display: inline-flex; align-items: center; gap: 8px;
}
.download-link-sm:hover { background: var(--primary-hover); box-shadow: 0 0 15px rgba(59,130,246,0.4); }

/* Footer */
footer { background: #020617; border-top: 1px solid var(--glass-border); padding: 80px 0 30px; }
.footer-bottom { margin-top: 60px; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.05); text-align: center; color: #475569; font-size: 0.9rem; }

/* --- MOBILE RESPONSIVE OVERRIDES (Fixing Width/Header) --- */
@media (max-width: 768px) {
    
    /* Layout Fixes */
    html, body { overflow-x: hidden; width: 100%; }
    .container { padding: 0 20px; }
    .section-padding { padding: 60px 0; }

    /* Header: Logo + Button visible, Links hidden */
    .nav-links { display: none; } 
    .logo { font-size: 1.2rem; }
    .btn-primary { 
        padding: 8px 16px; 
        font-size: 0.8rem; 
        gap: 5px;
    }
    header { padding: 0; } /* Reset extra padding */
    .nav-wrapper { padding: 0 20px; } /* Internal padding */

    /* Hero */
    .hero h1 { font-size: 2.2rem; }
    .stats-bar { grid-template-columns: 1fr 1fr; gap: 15px; padding: 20px; }
    .hero-images { display: none; } 

    /* Modal (Search) - Fixed Widths */
    .modal-overlay { padding: 0; }
    .modal-card:not(.modal-expanded) {
        width: 92%; 
        max-width: 400px;
        margin: 0 auto;
    }
    .search-content-wrapper { padding: 30px 20px; }
    .modern-input { font-size: 16px; } 

    /* Modal (Result Expanded) - Full Screen */
    .modal-card.modal-expanded {
        width: 100%; 
        height: 100dvh; 
        max-width: none;
        border-radius: 0;
        border: none;
        margin: 0;
    }
    .modal-inner-padding { padding: 20px; padding-top: 70px; }
    
    /* Sticky Close Button */
    .close-modal { 
        top: 15px; right: 15px; 
        background: rgba(15, 23, 42, 0.95); 
        border: 1px solid var(--glass-border);
        width: 36px; height: 36px; font-size: 1rem;
    }

    /* Result Header Stacking */
    .result-header-grid {
        grid-template-columns: 1fr; 
        gap: 15px; 
        align-items: flex-start; 
        padding-bottom: 20px;
    }
    .applicant-meta h3 { font-size: 1.8rem; margin-bottom: 5px; }
    .meta-row { flex-direction: column; gap: 5px; font-size: 0.85rem; }
    .status-badge { align-self: flex-start; font-size: 0.8rem; padding: 6px 15px; }
    
    /* Doc Viewer */
    .doc-header-bar { flex-direction: column; align-items: flex-start; gap: 15px; padding: 15px; }
    .doc-title { 
        width: 100%; 
        font-size: 0.9rem; 
        white-space: nowrap; 
        overflow: hidden; 
        text-overflow: ellipsis; 
    }
    .download-link-sm { width: 100%; justify-content: center; padding: 12px; }
    .doc-view-box { height: 60vh; min-height: 350px; }
    .doc-stack-wrapper { gap: 30px; }
    
    /* Grid Collapsing */
    .split-section { grid-template-columns: 1fr; gap: 40px; }
    .destination-grid, .features-grid, .review-grid { 
        grid-template-columns: 1fr; /* Single Column */
        gap: 20px; 
    }
    
    /* CTA Adjustments */
    .form-box { padding: 25px; }
    .form-box form { grid-template-columns: 1fr !important; }
}
/* --- Document Viewer (Full Stack) --- */
.doc-section-title {
    font-size: 1.1rem; color: var(--text-light); margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px; font-weight: 600;
}

.doc-stack-wrapper {
    display: flex; flex-direction: column; gap: 40px;
}

.doc-full-container {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
}

.doc-header-bar {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 25px;
}

.doc-title { font-weight: 600; color: white; display: flex; align-items: center; gap: 10px; }

/* Wrapper for content */
.doc-view-box {
    position: relative;
    width: 100%;
    background: #cbd5e1;
    /* Default height for PDFs/Frames */
    min-height: 500px; 
}

/* Responsive Image Class */
.doc-image {
    width: 100%;
    height: auto; /* Maintain Aspect Ratio */
    display: block;
    object-fit: contain; /* Ensure full visibility */
}

/* PDF Iframe Class */
.doc-iframe {
    width: 100%;
    height: 75vh; /* Fixed height for PDFs to allow internal scroll */
    border: none;
    display: block;
}

.download-link-sm {
    background: var(--primary); color: white;
    padding: 8px 20px; border-radius: 8px; font-size: 0.9rem; font-weight: 600;
    text-decoration: none; transition: 0.3s; display: inline-flex; align-items: center; gap: 8px;
}
.download-link-sm:hover { background: var(--primary-hover); box-shadow: 0 0 15px rgba(59,130,246,0.4); }

/* --- Mobile Responsive Overrides --- */
@media (max-width: 768px) {
    /* ... (Previous Mobile Styles) ... */

    /* Document Viewer Mobile */
    .doc-header-bar { flex-direction: column; align-items: flex-start; gap: 15px; padding: 15px; }
    .doc-title { 
        width: 100%; 
        font-size: 0.9rem; 
        white-space: nowrap; 
        overflow: hidden; 
        text-overflow: ellipsis; 
    }
    .download-link-sm { width: 100%; justify-content: center; padding: 12px; }
    
    /* For Images: Let height adapt naturally */
    .doc-view-box:has(.doc-image) {
        height: auto; 
        min-height: auto;
        background: #0f172a; /* Match dark theme for images */
    }
    
    /* For PDFs: Fixed height */
    .doc-view-box:has(.doc-iframe) {
        height: 60vh;
    }
    
    /* Fallback if :has not supported */
    .doc-image { width: 100%; }
    .doc-iframe { height: 60vh; }
}