/* --- GLOBAL VARIABLES & RESET --- */
:root {
    --primary: #4F46E5;
    --primary-dark: #4338ca;
    --accent: #818cf8;
    --success: #10b981;
    --danger: #ef4444;
    --bg-gradient: linear-gradient(135deg, #f3f4f6 0%, #e0e7ff 100%);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.6);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
    padding-bottom: 40px;
}

/* --- NAVIGATION --- */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-item {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s;
}

.nav-item:hover,
.nav-item.active {
    background: var(--primary);
    color: white !important;
}

/* --- LAYOUT UTILITIES --- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    text-align: center;
    margin: 40px 0;
}

/* --- BILLS TWO-COLUMN LAYOUT --- */
.bills-layout {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 1024px) {
    .bills-layout {
        grid-template-columns: 1fr;
    }
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: -webkit-linear-gradient(45deg, var(--primary), #9333ea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* --- UPLOAD SECTION --- */
.upload-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: sticky;
    top: 100px;
}

.drop-zone {
    border: 3px dashed #cbd5e1;
    border-radius: var(--radius);
    padding: 40px 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.5);
}

.drop-zone:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--primary);
    margin-bottom: 15px;
    opacity: 0.8;
}

/* --- FILE LIST --- */
.file-list {
    margin-top: 25px;
    text-align: left;
}

.file-item {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e5e7eb;
    animation: slideDown 0.3s ease-out;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-remove {
    color: var(--danger);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.btn-remove:hover {
    transform: scale(1.2);
}

/* --- ACTIONS & BUTTONS --- */
.btn-process {
    width: 100%;
    margin-top: 25px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.btn-process:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-process:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
}

/* --- RESULTS SECTION --- */
.results-container {
    min-height: 400px;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.empty-state {
    background: white;
    border-radius: var(--radius);
    padding: 60px 30px;
    text-align: center;
    border: 2px dashed #e5e7eb;
}

.empty-icon {
    width: 80px;
    height: 80px;
    color: #cbd5e1;
    margin: 0 auto 20px;
}

.empty-state h3 {
    color: var(--text-muted);
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.empty-state p {
    color: #9ca3af;
    font-size: 0.95rem;
}

.processing-message {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.processing-message .spinner {
    margin: 0 auto 20px;
}

.processing-message p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 500;
}

.result-card {
    background: white;
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 25px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.result-header {
    background: var(--primary);
    color: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.provider-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.result-body {
    padding: 25px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.data-point label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.data-point span {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.amount-highlight {
    color: var(--primary);
    font-size: 1.4rem !important;
}

/* --- LOADING ANIMATION --- */
.loading-overlay {
    display: none;
    text-align: center;
    padding: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .upload-card {
        padding: 20px;
    }

    .drop-zone {
        padding: 30px 10px;
    }
}


/* --- ADDITIONAL PAGES STYLES --- */
/* index.html */
/* --- CSS VARIABLES FOR THEME --- */
:root {
    --primary: #4F46E5;
    --primary-dark: #4338ca;
    --accent: #818cf8;
    --bg-gradient: linear-gradient(135deg, #f3f4f6 0%, #e0e7ff 100%);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

/* --- RESET & BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* --- NAVIGATION --- */
nav {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 5%;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

.btn-login {
    background: var(--primary);
    color: white !important;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.3s;
}

.btn-login:hover {
    background: var(--primary-dark);
}

/* --- HERO SECTION --- */
main {
    flex: 1;
    padding: 0 10px;
}

.hero {
    text-align: center;
    padding: 40px 10px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.hero h2 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    /* Responsive Font Size */
    line-height: 1.2;
    background: -webkit-linear-gradient(45deg, var(--primary), #9333ea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* --- SERVICES GRID --- */
.services-container {
    max-width: 1200px;
    margin: 0 auto 80px;
}

.services-grid {
    display: grid;
    /* Improved responsive grid logic */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.service-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: #eef2ff;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.service-card h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.service-card p {
    color: var(--text-muted);
    margin-bottom: 25px;
    flex-grow: 1;
}

.features-list {
    list-style: none;
    margin-bottom: 30px;
}

.features-list li {
    padding: 6px 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.features-list li svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.cta-button {
    text-align: center;
    background: var(--primary);
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    margin-top: auto;
    transition: background 0.3s;
}

.service-card:hover .cta-button {
    background: var(--primary-dark);
}

/* --- FOOTER --- */
footer {
    background: white;
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid #e5e7eb;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- MODAL (For Validation Demo) --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    position: relative;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

.error-msg {
    color: #dc2626;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    /* Simplified for demo, normally add hamburger js */
    .hero h1 {
        font-size: 2.5rem;
    }

    .service-card {
        padding: 25px;
    }
}