/* =========================================
   1. GLOBAL VARIABLES & THEME
   ========================================= */
:root {
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.1);
    
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.4);
    --secondary: #8b5cf6;
    
    --text-main: #ffffff;
    --text-muted: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Inter, Roboto, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    /* Changed from min-height: 100vh to 100dvh for better mobile support */
    min-height: 100dvh; 
    overflow-x: hidden; /* This stops the side-scrolling */
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Add this to ensure HTML doesn't allow scrolling either */
html {
    overflow-x: hidden;
}

/* =========================================
   2. BACKGROUND ORBS
   ========================================= */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    z-index: -1;
    opacity: 0.6;
    animation: float 15s infinite ease-in-out;
}

.orb-1 { width: 400px; height: 400px; background: #2563eb; top: -100px; left: -100px; }
.orb-2 { width: 300px; height: 300px; background: #7c3aed; bottom: 10%; right: -50px; animation-delay: -5s; }
.orb-3 { width: 200px; height: 200px; background: #06b6d4; top: 40%; left: 30%; filter: blur(120px); opacity: 0.3; }

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 40px); }
}

/* =========================================
   3. GLASSMORPHISM UTILITIES
   ========================================= */
.glass {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.glass-inset {
    background: rgba(0, 0, 0, 0.3);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
    border-radius: 12px;
}

/* =========================================
   4. NAVIGATION
   ========================================= */
   /* Remove the old background gradient from .nav-title */
.nav-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
    /* Ensure flex display so spans align perfectly */
    display: inline-flex;
    align-items: center;
}

/* --- Individual Character Colors with Neon Glow --- */

/* Cyan 'D' */
.char-cyan {
    color: #06b6d4;
    text-shadow: 0 0 15px rgba(6, 182, 212, 0.5);
    animation: pulseGlow 3s infinite alternate;
}

/* Blue 'O' */
.char-blue {
    color: #3b82f6;
    text-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
    animation: pulseGlow 3s infinite alternate 0.5s; /* Delay for wave effect */
}

/* Purple 'T' */
.char-purple {
    color: #a855f7;
    text-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
    animation: pulseGlow 3s infinite alternate 1s;
}

/* Pink 'pdf' */
.char-pink {
    color: #ec4899;
    font-weight: 600; /* Slightly lighter weight for the suffix */
    margin-left: 4px; /* Small gap */
    text-shadow: 0 0 15px rgba(236, 72, 153, 0.5);
    animation: pulseGlow 3s infinite alternate 1.5s;
}

/* Space fixer */
.char-space { width: 2px; }

/* --- Subtle Breathing Animation --- */
@keyframes pulseGlow {
    0% {
        opacity: 0.8;
        text-shadow: 0 0 5px currentColor;
        transform: scale(1);
    }
    100% {
        opacity: 1;
        text-shadow: 0 0 20px currentColor; /* Glow gets stronger */
        transform: scale(1.05); /* Slight pop */
    }
}
.topnav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 0 50px;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.nav-brand { display: flex; align-items: center; gap: 12px; }

/* Container for the logo */
.nav-brand-link {
    display: flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
}

/* The Logo Image */
.nav-logo-img {
    height: 55px; /* Fits perfectly inside the 70px nav */
    width: auto;  /* Keeps the circle shape correct */
    border-radius: 50%; /* Ensures it stays a perfect circle */
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Optional: Adds a neon glow behind the logo image */
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.2);
}

/* Funky Hover Effect */
.nav-brand-link:hover .nav-logo-img {
    transform: scale(1.1) rotate(-5deg); /* Pops up and tilts */
    box-shadow: 0 0 25px rgba(236, 72, 153, 0.5); /* Glow gets brighter */
}

.nav-title { font-size: 20px; font-weight: 700; letter-spacing: 0.5px; }

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 50%;
}
.nav-icon:hover {
    background: rgba(255,255,255,0.1);
}

/* =========================================
   5. LAYOUT & TEXT
   ========================================= */
.container-center {
    flex: 1;
    width: 100%;
    max-width: 800px;
    margin: 120px auto 40px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1, h2 { color: white; }

/* =========================================
   6. BUTTONS (With 3D Effect)
   ========================================= */
button { cursor: pointer; border: none; outline: none; }

.btn-primary {
    margin-top: 20px;
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* The 3D Shadow */
    box-shadow: 0 6px 0 #1e40af, 0 10px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.15s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: #3b82f6;
    box-shadow: 0 8px 0 #1e40af, 0 15px 20px rgba(0, 0, 0, 0.3);
}

.btn-primary:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #1e40af, 0 4px 5px rgba(0, 0, 0, 0.3);
}

.btn-primary:disabled {
    background: #475569;
    box-shadow: none;
    border-color: transparent;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid var(--glass-border);
    transition: 0.3s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* =========================================
   7. SPECIFIC: UPLOAD ZONE
   ========================================= */
.upload-area {
    border: 2px dashed var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 25px;
}

.upload-area:hover, .upload-area.dragover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 15px;
    opacity: 0.8;
}

.upload-text { font-size: 1.1rem; margin-bottom: 10px; color: #fff; }
.upload-hint { font-size: 0.9rem; color: var(--text-muted); }

/* =========================================
   8. SPECIFIC: THUMBNAILS GRID
   ========================================= */
.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px; 
}

/* Custom Scrollbar */
.thumbnails-grid::-webkit-scrollbar { width: 6px; }
.thumbnails-grid::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius: 10px; }
.thumbnails-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }

.thumb-wrapper {
    position: relative;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
    transform: scale(0.8);
    background: #000;
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-remove {
    position: absolute;
    top: 5px; right: 5px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0;
    transition: 0.2s;
}

.thumb-wrapper:hover .thumb-remove { opacity: 1; }
.thumb-remove:hover { transform: scale(1.1); }

/* =========================================
   9. SPECIFIC: PREVIEW SECTION
   ========================================= */
.preview-section {
    display: none;
    flex-direction: column;
    height: 100%;
}

.preview-section.active {
    display: flex;
    animation: fadeInUp 0.5s ease forwards;
}

.pdf-frame-container {
    flex: 1;
    overflow: hidden;
    margin: 20px 0;
    min-height: 400px;
    border: 1px solid var(--glass-border);
}

.pdf-frame { width: 100%; height: 100%; border: none; }

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: auto;
}

/* Helper Classes */
.hidden { display: none !important; }

/* Animations */
@keyframes popIn {
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeInUp 0.8s ease forwards; opacity: 0; }

.pulse-subtle { animation: pulseS 3s infinite; }
@keyframes pulseS {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* --- Footer Container --- */
footer {
    text-align: center;
    padding: 25px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
    border-top: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.4); /* Subtle glass background */
    backdrop-filter: blur(5px);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

/* --- Heartbeat Animation --- */
.heart-beat {
    color: #ef4444;
    display: inline-block;
    animation: heartbeat 1.5s infinite ease-in-out;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.3); }
    30% { transform: scale(1); }
    45% { transform: scale(1.3); }
    60% { transform: scale(1); }
}

/* --- Copyright "Swastik" Effect --- */
.copyright-text {
    font-size: 0.85rem;
    opacity: 0.9;
}

.name-highlight {
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    
    /* The Gold/Sunset Gradient */
    background: linear-gradient(
        90deg, 
        #fbbf24, /* Gold */
        #f472b6, /* Pink */
        #a78bfa, /* Purple */
        #fbbf24  /* Gold loop */
    );
    
    background-size: 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    /* The Shimmer Animation */
    animation: shineName 3s linear infinite;
    
    /* Glow */
    filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.4));
    display: inline-block;
}

@keyframes shineName {
    to {
        background-position: 200% center;
    }
}
/* --- UPDATED RESPONSIVE SECTION --- */
@media(max-width: 600px){
    /* 1. Fix Navbar Overflow */
    .topnav { 
        padding: 0 15px; /* Reduced from 50px to 15px */
        height: 60px;    /* Slightly smaller height */
    }

    /* 2. Resize Logo Text */
    .nav-title {
        font-size: 1.2rem; /* Smaller text so it fits */
    }
    
    .nav-logo-img {
        height: 40px; /* Smaller logo image */
    }

    /* 3. Adjust Menu Spacing */
    .nav-menu {
        gap: 15px; /* Bring links closer together */
    }
    
    .nav-menu a {
        font-size: 0.9rem; /* Smaller link text */
    }

    /* 4. Fix Container Spacing */
    .container-center { 
        margin-top: 90px; /* Adjust top margin for smaller nav */
        margin-bottom: 20px;
        width: 100%;
        max-width: 100%; /* Ensure it doesn't overflow */
        padding: 0 15px;
    }

    .hero-text h1 { font-size: 2rem; }
    
    /* 5. Adjust Cards */
    .tool-card { 
        padding: 20px; 
        gap: 15px; 
    }
    
    .icon-box { 
        width: 50px; 
        height: 50px; 
        font-size: 22px; 
    }
    
    .arrow-icon { display: none; } 
    
    /* 6. Fix Footer Text Size */
    footer {
        padding: 15px;
        font-size: 0.8rem;
    }
}