/* /var/www/routemaster/public/assets/style.css */

:root {
    /* Core Color Palette */
    --primary-color: #0f172a;      /* Deep slate for text/headings */
    --accent-color: #2563eb;       /* High-visibility blue for primary actions */
    --accent-hover: #1d4ed8;       /* Darker blue for active states */
    --bg-color: #f8fafc;           /* Light gray off-white for the background */
    --card-bg: #ffffff;            /* Pure white for containers */
    --text-main: #334155;
    --text-muted: #64748b;
    --error-color: #ef4444;        /* Crisp red for alerts */
    --error-bg: #fef2f2;
    --border-color: #e2e8f0;
    --focus-ring: rgba(37, 99, 235, 0.3);
}

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

body {
    /* System fonts load instantly without external network requests */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    
    
    
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Application Root Container */
#app-root {
    width: 100%;
    
    padding: 20px;
}

#dashboard-container {
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    background: transparent; /* Let the sub-pages define their own background */
    box-shadow: none;
}

/* Login Container */
#login-container {
    background: var(--card-bg);
    padding: 35px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#login-container h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Form Elements */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.input-group input[type="text"],
.input-group input[type="password"] {
    width: 100%;
    padding: 14px 12px;
    font-size: 1rem; /* 16px font size PREVENTS iOS Safari from auto-zooming on focus */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.input-group input[type="text"]:focus,
.input-group input[type="password"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
    background-color: #ffffff;
}

/* Checkbox Styling */
.input-group.checkbox {
    margin-top: 10px;
    margin-bottom: 25px;
}

.input-group.checkbox label {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
}

.input-group.checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

/* Submit Button (Fat-finger friendly) */
button {
    width: 100%;
    background-color: var(--accent-color);
    color: #ffffff;
    border: none;
    padding: 16px;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
}

button:hover {
    background-color: var(--accent-hover);
}

button:active {
    transform: scale(0.98); /* Provides tactile visual feedback when tapped */
}

button:disabled {
    background-color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

/* Error Message Banner */
#login-error {
    background-color: var(--error-bg);
    color: var(--error-color);
    padding: 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid #fecaca;
    text-align: center;
}

/* Basic Dashboard Shell Styling (Placeholder) */
#dashboard-container {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    color: var(--text-muted);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ==================================================== */
/* Driver Dashboard Specific Styles                    */
/* ==================================================== */

.driver-view {
    width: 100%;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.driver-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.driver-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Delivery Cards */
.delivery-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    transition: opacity 0.3s ease;
}

.delivery-card.is-completed {
    opacity: 0.6;
    background-color: #f1f5f9;
}

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

.stop-number {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.pending { background-color: #fef3c7; color: #d97706; }
.status-badge.completed { background-color: #dcfce7; color: #166534; }

.card-body { margin-bottom: 15px; }

.customer-name {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.address {
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.4;
}

.delivery-notes {
    margin-top: 10px;
    padding: 10px;
    background-color: #fffbeb;
    border-left: 3px solid #fbbf24;
    font-size: 0.85rem;
    color: #92400e;
    border-radius: 0 4px 4px 0;
}

/* Action Buttons Grid */
.card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Fallback for full width if it's the only button */
.card-actions:has(> :last-child:nth-child(1)) > .btn-action {
    grid-column: span 2;
}

.btn-action {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-map {
    background-color: var(--bg-color);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.btn-map:hover { background-color: #e2e8f0; }

.btn-complete {
    background-color: #10b981;
    color: white;
}

.btn-complete:hover { background-color: #059669; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
}

.btn-outline:hover { background: #f1f5f9; color: var(--primary-color); }

/* Layout Modes */
.login-layout {
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-layout #login-container {
    width: 100%;
    max-width: 420px; /* Keep login narrow */
}

.dashboard-layout {
    display: block; /* Allows full-width content */
    background-color: #f1f5f9;
}

/* Ensure the admin/driver content fills the space */
#view-content {
    width: 100%;
    max-width: 1600px; /* Modern desktop max-width */
    margin: 0 auto;
}

.session-timeout-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #fff9db; /* Soft, non-aggressive amber/yellow */
    border: 1px solid #ffe066;
    color: #8c6d05;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 20px; /* Pushes the form fields down cleanly */
    text-align: left;
}

.session-timeout-banner svg {
    flex-shrink: 0;
    color: #f59f00; /* Amber icon color */
}