/*
 * Basic styling for ROTZ Email Butler.
 *
 * This stylesheet provides a clean, responsive layout using
 * Flexbox. Feel free to customize colours and spacing to match
 * your branding. For a production system consider using a
 * framework like Bootstrap or Tailwind for a more polished UI.
 */


/*
 * Modern styling for ROTZ Email Butler
 */

/*
 * Root styling
 *
 * The application now adopts a dark theme reminiscent of modern productivity tools.  Dark
 * surfaces reduce eye strain and make coloured accents stand out.  Text colours are
 * lightened for contrast and readability.  Elements like cards and charts use slightly
 * lighter shades to create depth without overwhelming the user.  Feel free to adjust
 * colours further to suit your branding.
 */
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background-color: #121826; /* dark background */
    color: #e5e7eb; /* light text for contrast */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Generic container used in header and footer */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Container is no longer used globally; individual wrappers handle spacing */

/* Header (top bar) */
.header {
    background-color: #1f2937;
    color: #f9fafb;
    height: 60px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.header .container {
    width: 100%;
    max-width: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.header .logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
}

/* Logo image and text */
.logo-img {
    height: 32px;
    width: 32px;
    margin-right: 8px;
}
.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f9fafb;
}
.header .nav {
    display: flex;
    align-items: center;
}
.header .nav-user {
    margin-right: 1rem;
    font-size: 0.9rem;
    color: #d1d5db;
}
.header .nav .btn {
    margin-left: 0.5rem;
    color: #f9fafb;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    background-color: #3b82f6;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}
.header .nav .btn:hover {
    background-color: #2563eb;
}

/* Sidebar */
/* Sidebar styling for dark mode */
.sidebar {
    width: 240px;
    background-color: #111827;
    color: #e5e7eb;
    position: fixed;
    top: 60px;
    bottom: 0;
    left: 0;
    padding-top: 1rem;
    overflow-y: auto;
    border-right: 1px solid #1f2937;
}
.sidebar .menu {
    list-style: none;
    padding: 0;
    margin: 0;
}
/* Sidebar links */
.sidebar .menu li a {
    display: block;
    padding: 0.8rem 1.2rem;
    color: #a5b4fc;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-left: 3px solid transparent;
}
.sidebar .menu li a:hover {
    background-color: #1f2937;
    color: #f9fafb;
    border-left-color: #6366f1;
}

/* Main content area */
/* Main content area respects dark background while allowing light cards */
.main {
    margin-left: 240px;
    padding: 80px 20px 40px;
    flex: 1;
    background-color: transparent;
}

/* Dashboard styling */
.dashboard-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}
/* Dashboard title adopts lighter colour */
.dashboard-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #f9fafb;
}
.stats-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}
/* Statistics cards with modern gradient and shadows */
.stat-card {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    flex: 1 1 200px;
    min-width: 180px;
}
.stat-title {
    font-size: 0.85rem;
    color: #dcd7fe;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
}
.charts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
/* Chart cards use subtle dark surfaces */
.chart-card {
    background: #1f2937;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    flex: 1 1 300px;
    min-width: 280px;
}
.chart-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #f3f4f6;
}

/* Digest summary styling */
.digest-summary {
    background-color: #312e81;
    border-left: 4px solid #6366f1;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 20px;
    color: #e0e7ff;
}
.digest-summary .digest-text {
    font-size: 0.9rem;
    color: inherit;
    margin: 0;
}

/* Footer styling */
/* Footer styling for dark mode */
.footer {
    background-color: #1f2937;
    border-top: 1px solid #374151;
    padding: 1rem 0;
    color: #9ca3af;
    font-size: 0.875rem;
}
.footer .container {
    margin-left: 240px;
    padding: 0 20px;
}

/* Generic card styling (used elsewhere) */
.card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}


.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    color: #e5e7eb;
}

.table th,
 .table td {
    border: 1px solid #374151;
    padding: 0.5rem;
}

.table th {
    border: 1px solid #374151;
    padding: 0.5rem;
    background-color: #1f2937;
    text-align: left;
    color: #f3f4f6;
}


.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    max-width: 450px;
    padding: 0.5rem;
    border: 1px solid #374151;
    border-radius: 4px;
    background-color: #1e293b;
    color: #f9fafb;
}

/* Primary button styling */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #3b82f6;
    color: #f9fafb;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* Secondary button styling (outline style for dark backgrounds) */
.btn.btn-secondary {
    background-color: #374151;
    color: #e5e7eb;
}
.btn.btn-secondary:hover {
    background-color: #4b5563;
    color: #f9fafb;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Alert styles for errors and success */
.alert-error {
    background-color: #991b1b;
    color: #fef2f2;
}

.alert-success {
    background-color: #14532d;
    color: #dcfce7;
}

/* Checkbox alignment */
.form-group input[type="checkbox"] {
    margin-right: 0.5rem;
    vertical-align: middle;
}
.form-group label.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Google button styling */
.btn-google {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #db4437;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    margin-top: 0.5rem;
}
.btn-google:hover {
    background-color: #c23321;
}

/* Status badge for connection indicator */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
}

/* Category badges for quick visual cues */
.priority-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #f9fafb;
    text-transform: capitalize;
}
.priority-high {
    background-color: #b91c1c;
}
.priority-medium {
    background-color: #ca8a04;
}
.priority-low {
    background-color: #16a34a;
}
.category-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #f9fafb;
    text-transform: capitalize;
}
.category-work {
    background-color: #3b82f6;
}
.category-personal {
    background-color: #10b981;
}
.category-marketing {
    background-color: #f59e0b;
}
.category-finance {
    background-color: #059669;
}
.category-travel {
    background-color: #d97706;
}
.category-shopping {
    background-color: #c026d3;
}
.category-social {
    background-color: #db2777;
}
.category-spam {
    background-color: #991b1b;
}
.category-important {
    background-color: #ea580c;
}
.status-ok {
    background-color: #10b981; /* green */
}
.status-error {
    background-color: #ef4444; /* red */
}
/* Additional statuses for indexing and processing */
.status-indexing {
    background-color: #f59e0b; /* amber */
}
.status-indexed {
    background-color: #3b82f6; /* blue */
}
.status-processing {
    background-color: #6366f1; /* indigo */
}
.status-processed {
    background-color: #0d9488; /* teal */
}