:root {
    --bg-main: #0B0F19;
    --bg-card: rgba(18, 24, 38, 0.75);
    --bg-card-hover: rgba(26, 35, 54, 0.85);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(16, 185, 129, 0.4);
    
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;

    --accent-emerald: #10B981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.3);
    --accent-cyan: #06B6D4;
    --accent-green: #059669;

    --btn-primary-bg: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --btn-primary-hover: linear-gradient(135deg, #059669 0%, #047857 100%);
    
    --danger-red: #EF4444;
    --warning-yellow: #F59E0B;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.25);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-theme {
    --bg-main: #F8FAFC;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-accent: rgba(16, 185, 129, 0.5);
    
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;

    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', 'Hind Siliguri', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Dynamic Ambient Glow */
.glow-bg {
    position: fixed;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.18) 0%, rgba(6, 182, 212, 0.08) 50%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    z-index: 0;
    filter: blur(80px);
}

/* Navigation Bar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 15, 25, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: var(--btn-primary-bg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    box-shadow: var(--shadow-glow);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-emerald);
}

.lang-switch-group {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.lang-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.lang-btn.active {
    background: var(--accent-emerald);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

/* Layout */
.main-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    flex: 1;
    position: relative;
    z-index: 1;
    width: 100%;
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-normal);
}

.card:hover {
    border-color: var(--border-accent);
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 40px;
}

.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-full);
    color: var(--accent-emerald);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #FFFFFF 0%, #9CA3AF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 650px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

/* Search Form */
.search-card {
    text-align: left;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.full-width {
    grid-column: 1 / -1;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.input-group label i {
    color: var(--accent-emerald);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 48px 16px 48px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: var(--transition-fast);
}

.light-theme .input-wrapper input {
    background: rgba(255, 255, 255, 0.8);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-emerald);
    box-shadow: 0 0 0 4px var(--accent-emerald-glow);
}

.clear-btn {
    position: absolute;
    right: 14px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-full);
}

.clear-btn:hover {
    color: var(--text-primary);
}

/* Language Radios */
.radio-options {
    display: flex;
    gap: 16px;
}

.radio-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.light-theme .radio-card {
    background: rgba(255, 255, 255, 0.8);
}

.radio-card:hover {
    border-color: var(--accent-emerald);
}

.radio-card input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    position: relative;
    transition: var(--transition-fast);
}

.radio-card input[type="radio"]:checked ~ .radio-custom {
    border-color: var(--accent-emerald);
    background: var(--accent-emerald);
}

.radio-card input[type="radio"]:checked ~ .radio-custom::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
}

.radio-label {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Submit Buttons */
.btn-primary {
    width: 100%;
    padding: 16px 28px;
    background: var(--btn-primary-bg);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: var(--shadow-glow);
    transition: var(--transition-fast);
}

.btn-primary:hover {
    background: var(--btn-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(16, 185, 129, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Quick Presets */
.quick-presets {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}

.preset-label {
    color: var(--text-secondary);
}

.chip-btn {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--accent-emerald);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.chip-btn:hover {
    background: rgba(16, 185, 129, 0.25);
}

/* Progress & Status Modal Overlay */
.status-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    transition: opacity var(--transition-normal);
}

.status-modal.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.status-card {
    background: var(--bg-main);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.spinner-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pulse-ring {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid var(--accent-emerald);
    animation: pulseGlow 1.8s infinite ease-in-out;
}

.spinner {
    font-size: 2.2rem;
    color: var(--accent-emerald);
}

@keyframes pulseGlow {
    0% { transform: scale(0.8); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 0.3; }
    100% { transform: scale(0.8); opacity: 0.8; }
}

.status-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.status-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.live-stats {
    display: flex;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.stat-box {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-emerald);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 24px;
}

.progress-bar-fill {
    height: 100%;
    width: 15%;
    background: var(--btn-primary-bg);
    border-radius: var(--radius-full);
    animation: indeterminateFill 2s infinite linear;
}

@keyframes indeterminateFill {
    0% { width: 10%; margin-left: 0; }
    50% { width: 60%; margin-left: 20%; }
    100% { width: 10%; margin-left: 90%; }
}

.btn-secondary {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.danger-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger-red);
    color: var(--danger-red);
}

/* Alert Notification */
.alert-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: #F87171;
    margin-bottom: 30px;
}

.alert-box.hidden {
    display: none;
}

.alert-icon {
    font-size: 1.4rem;
}

.alert-content {
    flex: 1;
}

.alert-content h4 {
    font-size: 0.95rem;
    font-weight: 700;
}

.alert-content p {
    font-size: 0.85rem;
    opacity: 0.9;
}

.alert-close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.1rem;
    cursor: pointer;
}

/* Results & PDF Preview */
.result-section {
    margin-bottom: 40px;
}

.result-section.hidden {
    display: none;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.result-info h3 {
    font-size: 1.3rem;
    color: var(--accent-emerald);
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

.result-actions {
    display: flex;
    gap: 12px;
}

.btn-success {
    padding: 12px 20px;
    background: var(--btn-primary-bg);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-glow);
    transition: var(--transition-fast);
}

.btn-success:hover {
    background: var(--btn-primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    padding: 12px 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-emerald);
}

.pdf-frame-wrapper {
    width: 100%;
    height: 750px;
    background: #1E293B;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.pdf-frame-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* History Section */
.history-section {
    margin-top: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.text-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.text-btn:hover {
    color: var(--danger-red);
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.empty-history {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
}

.empty-history i {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.history-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
}

.history-card:hover {
    border-color: var(--accent-emerald);
    transform: translateY(-2px);
}

.history-card-info h5 {
    font-size: 0.95rem;
    font-weight: 700;
    font-family: monospace;
}

.history-card-info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.history-card-actions {
    display: flex;
    gap: 8px;
}

.history-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.history-icon-btn:hover {
    background: var(--accent-emerald);
    color: #fff;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 60px;
}

.sub-footer {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 6px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.8rem;
    }
    .pdf-frame-wrapper {
        height: 500px;
    }
    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .result-actions {
        width: 100%;
    }
    .btn-success, .btn-outline {
        flex: 1;
        justify-content: center;
    }
}
