:root {
    --lummus-primary: #1E3A5F;
    --lummus-accent: #00D9FF;
    --lummus-secondary: #00FF88;
    --lummus-success: #00FF88;
    --lummus-warning: #F59E0B;
    --lummus-danger: #EF4444;
    --lummus-dark: #0B1426;
    --lummus-light: #F8FAFC;
    --lummus-gray: #64748B;
    --lummus-purple: #8B5CF6;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--lummus-dark) 0%, var(--lummus-primary) 100%);
    min-height: 100vh;
    color: var(--lummus-light);
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(0, 217, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 255, 136, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: backgroundShift 20s ease-in-out infinite alternate;
}

@keyframes backgroundShift {
    0% { transform: translateX(0) translateY(0) scale(1); }
    100% { transform: translateX(-20px) translateY(-10px) scale(1.02); }
}

.main-container {
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.glass-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--lummus-accent), transparent);
    opacity: 0.6;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(0, 217, 255, 0.3);
}

.glow-button {
    background: linear-gradient(45deg, var(--lummus-accent), var(--lummus-secondary));
    border: none;
    border-radius: 12px;
    color: var(--lummus-dark);
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 15px rgba(0, 217, 255, 0.3),
        0 0 30px rgba(0, 217, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.glow-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(45deg);
    transition: all 0.6s;
    opacity: 0;
}

.glow-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(0, 217, 255, 0.4),
        0 0 50px rgba(0, 217, 255, 0.2);
}

.glow-button:hover::before {
    animation: shimmer 0.6s ease-out;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); opacity: 0; }
}

.section-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 0.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.section-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--lummus-accent), transparent);
    transition: left 0.5s ease;
}

.section-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--lummus-accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.1);
}

.section-card:hover::before {
    left: 100%;
}

.progress-ring {
    transform: rotate(-90deg);
    filter: drop-shadow(0 0 10px var(--lummus-accent));
}

.progress-ring-circle {
    stroke: var(--lummus-accent);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
    animation: progressGlow 2s ease-in-out infinite alternate;
}

@keyframes progressGlow {
    0% { filter: drop-shadow(0 0 5px var(--lummus-accent)); }
    100% { filter: drop-shadow(0 0 20px var(--lummus-accent)); }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--lummus-accent), var(--lummus-secondary), var(--lummus-purple));
    background-size: 200% 200%;
    text-align: center;
    margin-bottom: 1rem;
    animation: gradientShift 4s ease-in-out infinite;
    display: inline-block;
    
    /* Modern browsers with background-clip support */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    /* Fallback color for older browsers - this will be overridden by background-clip if supported */
    color: var(--lummus-accent);
}

/* Enhanced fallback with better browser detection */
@supports not (-webkit-background-clip: text) {
    .hero-title {
        color: var(--lummus-accent) !important;
        background: none !important;
        text-shadow: 0 0 30px rgba(0, 217, 255, 0.3);
        -webkit-text-fill-color: var(--lummus-accent) !important;
    }
}

/* Additional fallback for Firefox */
@-moz-document url-prefix() {
    .hero-title {
        color: var(--lummus-accent);
        background: linear-gradient(45deg, var(--lummus-accent), var(--lummus-secondary), var(--lummus-purple));
        background-size: 200% 200%;
        -moz-background-clip: text;
        -moz-text-fill-color: transparent;
    }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Welcome text cutout effect */
.welcome-text {
    font-size: 1.5rem;
    font-weight: 900;
    text-align: center;
    background: linear-gradient(135deg, var(--lummus-dark) 0%, var(--lummus-primary) 100%);
    background-size: 200% 200%;
    background-attachment: fixed;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    position: relative;
    animation: gradientShift 4s ease-in-out infinite;
}

/* Fallback for browsers that don't support background-clip */
@supports not (-webkit-background-clip: text) {
    .welcome-text {
        color: var(--lummus-primary) !important;
        background: none !important;
        font-weight: 900;
        text-shadow: 0 0 20px rgba(30, 58, 95, 0.3);
        -webkit-text-fill-color: var(--lummus-primary) !important;
    }
}

.subtitle {
    font-size: 1.3rem;
    color: var(--lummus-gray);
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.input-field {
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: var(--lummus-light);
    padding: 14px 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
}

.input-field:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--lummus-accent);
    box-shadow: 
        0 0 0 3px rgba(0, 217, 255, 0.1),
        0 0 20px rgba(0, 217, 255, 0.1);
    transform: scale(1.02);
}

.input-field::placeholder {
    color: rgba(248, 250, 252, 0.5);
}

.upload-zone {
    border: 2px dashed rgba(0, 217, 255, 0.4);
    border-radius: 16px;
    padding: 4rem 3rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.04);
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, rgba(0, 217, 255, 0.05), transparent);
    animation: rotate 10s linear infinite;
    opacity: 0;
    transition: opacity 0.3s;
}

.upload-zone:hover::before {
    opacity: 1;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.upload-zone:hover {
    border-color: var(--lummus-accent);
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.1);
}

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    transition: all 0.3s ease;
}

.status-pending { 
    background-color: #64748B;
    box-shadow: 0 0 5px rgba(100, 116, 139, 0.3);
}

.status-active { 
    background-color: var(--lummus-accent); 
    animation: statusPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 15px var(--lummus-accent);
}

.status-completed { 
    background-color: var(--lummus-secondary);
    box-shadow: 0 0 10px var(--lummus-secondary);
    animation: completedGlow 0.5s ease-out;
}

@keyframes statusPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 15px var(--lummus-accent);
    }
    50% { 
        transform: scale(1.2);
        box-shadow: 0 0 25px var(--lummus-accent);
    }
}

@keyframes completedGlow {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

/* Loading animations */
.loading-dots {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 20px;
}

.loading-dots div {
    position: absolute;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lummus-accent);
    animation: loadingDots 1.2s linear infinite;
}

.loading-dots div:nth-child(1) { left: 8px; animation-delay: 0s; }
.loading-dots div:nth-child(2) { left: 32px; animation-delay: -0.4s; }
.loading-dots div:nth-child(3) { left: 56px; animation-delay: -0.8s; }

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Success celebration animation */
.celebration {
    animation: celebrate 0.6s ease-out;
}

@keyframes celebrate {
    0% { transform: scale(0.8) rotate(-10deg); }
    50% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Error handling styles */
.error-container {
    padding: 2rem;
    text-align: center;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 12px;
    margin: 2rem 0;
}

.error-icon {
    font-size: 3rem;
    color: #ef4444;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #ef4444;
}

.error-message {
    color: var(--lummus-gray);
    margin-bottom: 1.5rem;
}

.retry-button {
    background: linear-gradient(45deg, #ef4444, #dc2626);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 20, 38, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
}

.loading-content {
    text-align: center;
    color: var(--lummus-light);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 217, 255, 0.3);
    border-top: 4px solid var(--lummus-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.loading-subtext {
    font-size: 0.9rem;
    color: var(--lummus-gray);
}

/* Connection status indicator */
.connection-status {
    position: fixed;
    bottom: 4.5rem;
    right: 1rem;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 1000;
    transition: all 0.3s ease;
}

.connection-online {
    background: rgba(0, 255, 136, 0.2);
    color: var(--lummus-secondary);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.connection-offline {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Warning styles */
.warning-container {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
}

.warning-title {
    color: #f59e0b;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.warning-message {
    color: var(--lummus-gray);
}

/* Progress visualization styles */
.progress-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: conic-gradient(var(--lummus-accent) 0deg, var(--lummus-gray) 0deg);
    transition: all 0.3s ease;
}

.progress-circle::before {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    background: var(--lummus-dark);
    border-radius: 50%;
    z-index: 1;
}

.progress-percentage {
    position: relative;
    z-index: 2;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--lummus-light);
}

/* Container for centering the progress circle */
#progress-circle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.section-card.completed {
    border-color: var(--lummus-secondary);
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 217, 255, 0.05) 100%);
}

.section-card.completed .fas {
    color: var(--lummus-secondary) !important;
}

.section-card.processing {
    border-color: var(--lummus-warning);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(251, 191, 36, 0.05) 100%);
    animation: processingPulse 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.section-card.processing::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(245, 158, 11, 0.1), transparent);
    animation: processingShimmer 3s linear infinite;
}

.section-card.processing .fas {
    color: var(--lummus-warning) !important;
    position: relative;
    z-index: 1;
}

@keyframes processingPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
    }
}

@keyframes processingShimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.section-card.error {
    border-color: var(--lummus-danger);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.05) 100%);
}

.section-card.error .fas {
    color: var(--lummus-danger) !important;
}

.section-card.pending {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
}

.section-card.pending .fas {
    color: var(--lummus-gray) !important;
}

/* Footer styles */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(11, 20, 38, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    z-index: 100;
    transition: all 0.3s ease;
}

.app-footer:hover {
    background: rgba(11, 20, 38, 0.95);
    border-top-color: rgba(0, 217, 255, 0.2);
}

/* Input page uses Card structure for proper alignment */
/* Header and form now use identical Card/CardBody structure */
/* IMPORTANT: Clear browser cache (Ctrl+Shift+R) if changes don't appear */

/* Page-specific styles */
.login-page, .input-page, .validation-page, .progress-page, .results-page, .error-page {
    min-height: 100vh;
    padding-bottom: 60px; /* Add space for fixed footer */
}

/* Utility classes */
.text-center {
    text-align: center;
}

/* Header styles */
.header-row {
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

/* Input content styling */
.input-content {
    margin: 1rem 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .glass-card {
        margin: 1rem;
        border-radius: 16px;
    }
    
    .upload-zone {
        padding: 2rem 1.5rem;
    }
    
    .loading-overlay {
        padding: 2rem;
    }
    
    .error-container {
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* Document Scanning Animation */
.document-scanner {
    position: relative;
    width: 120px;
    height: 160px;
    margin: 0 auto 1.5rem;
}

.doc-icon {
    width: 100%;
    height: 100%;
    border: 2px solid var(--lummus-accent);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    background: rgba(0, 217, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-icon i {
    color: var(--lummus-accent);
    z-index: 1;
    position: relative;
}

.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--lummus-accent), 
        var(--lummus-secondary), 
        transparent);
    box-shadow: 0 0 20px var(--lummus-accent);
    animation: scanning 2s linear infinite;
    z-index: 2;
}

@keyframes scanning {
    0% { 
        top: 0; 
        opacity: 0;
        transform: scaleX(0.3);
    }
    10% { 
        opacity: 1;
        transform: scaleX(1);
    }
    90% { 
        opacity: 1;
        transform: scaleX(1);
    }
    100% { 
        top: calc(100% - 2px); 
        opacity: 0;
        transform: scaleX(0.3);
    }
}

.scanning-text {
    text-align: center;
    margin-top: 1rem;
}

.scanning-text h5 {
    color: var(--lummus-accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.scanning-text p {
    color: var(--lummus-gray);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Pulse animation for scanning status */
.scanning-pulse {
    animation: scanningPulse 2s ease-in-out infinite;
}

@keyframes scanningPulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Success Checkmark Animation Styles */
.success-checkmark {
    filter: drop-shadow(0 0 20px var(--lummus-success));
    animation: successCheckIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes successCheckIn {
    0% { 
        transform: scale(0.3) rotate(-45deg);
        opacity: 0;
        filter: drop-shadow(0 0 0px var(--lummus-success));
    }
    50% { 
        transform: scale(1.2) rotate(0deg);
        opacity: 1;
        filter: drop-shadow(0 0 25px var(--lummus-success));
    }
    100% { 
        transform: scale(1) rotate(0deg);
        opacity: 1;
        filter: drop-shadow(0 0 20px var(--lummus-success));
    }
}

.success-checkmark:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 30px var(--lummus-success));
    animation: successPulse 1.5s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% { 
        transform: scale(1.1);
        filter: drop-shadow(0 0 30px var(--lummus-success));
    }
    50% { 
        transform: scale(1.15);
        filter: drop-shadow(0 0 40px var(--lummus-success));
    }
}