:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #10b981;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 10000;
    backdrop-filter: blur(8px);
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

#authLayout {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-container {
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 440px;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin: 0 auto;     
    padding: 15px;
    width: 100%;
    max-width: 350px;  
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
	margin-left: 90px;
}

.app-logo {
    width: 100%;
    max-width: 180px;  
    height: auto;
    object-fit: contain;
}

.login-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
	margin-top: 1.5rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-left: 0.25rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    width: 20px;
    height: 20px;
    color: var(--text-light);
    pointer-events: none;
    z-index: 1;
}

.input-wrapper input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.input-wrapper input::placeholder {
    color: var(--text-light);
}

.error {
    padding: 0.875rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 4px solid var(--danger-color);
    display: none;
}

.error:not(:empty) {
    display: block;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    margin-top: 0.5rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn svg {
    width: 20px;
    height: 20px;
}

/* ==========================================
   MAIN LAYOUT
   ========================================== */
#mainLayout {
    background: var(--bg-secondary);
}

/* ==========================================
   HEADER
   ========================================== */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-lg);
    color: white;
    gap: 1.5rem;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rider-avatar {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.rider-avatar svg {
    width: 28px;
    height: 28px;
    color: white;
}

.rider-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rider-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.rider-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    opacity: 0.95;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
    }
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.earnings-display {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.earnings-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.earnings-icon svg {
    width: 22px;
    height: 22px;
    color: white;
}

.earnings-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.earnings-label {
    font-size: 0.75rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.earnings-amount {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.header-right {
    display: flex;
    align-items: center;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.125rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.logout-btn svg {
    width: 18px;
    height: 18px;
}

/* ==========================================
   CONTENT AREA
   ========================================== */
.content-area {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ==========================================
   BOTTOM NAVIGATION
   ========================================== */
.bottom-nav {
    display: flex;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.75rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    position: relative;
}

.nav-btn svg {
    width: 24px;
    height: 24px;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-btn.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-btn.active svg {
    stroke-width: 2.5;
}

.nav-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 3px;
    background: var(--primary-color);
    border-radius: 0 0 3px 3px;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 1024px) {
    .header-center {
        order: 3;
        flex: 1 0 100%;
        justify-content: flex-start;
    }
    
    .earnings-display {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }
    
    .earnings-amount {
        font-size: 1.25rem;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .login-container {
        padding: 2rem 1.5rem;
    }
    
    .logo-container {
        width: 75px;
        height: 75px;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 640px) {
    .logout-btn span {
        display: none;
    }
    
    .logout-btn {
        padding: 0.625rem 0.75rem;
    }
    
    .nav-btn {
        font-size: 0.7rem;
        padding: 0.625rem 0.375rem;
    }
    
    .nav-btn svg {
        width: 22px;
        height: 22px;
    }
    
    .earnings-icon {
        width: 36px;
        height: 36px;
    }
    
    .earnings-icon svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .rider-avatar {
        width: 45px;
        height: 45px;
    }
    
    .rider-avatar svg {
        width: 24px;
        height: 24px;
    }
    
    .rider-info h3 {
        font-size: 1rem;
    }
    
    .rider-status {
        font-size: 0.75rem;
    }
}

/* ==========================================
   ANIMATIONS
   ========================================== */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}