/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #080c12;
    --secondary-color: #2a2117;
    --success-color: #080c12;
    --danger-color: #ef4444;
    --warning-color: #f0b44f;
    --info-color: #2a2117;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    padding-bottom: 80px;
}

/* Night Mode */
body.night-mode {
    --bg-color: #1f2937;
    --card-bg: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --border-color: #4b5563;
}

/* Top Navigation */
.top-nav {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: bold;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.night-mode-toggle,
.profile-icon {
    cursor: pointer;
    font-size: 1.25rem;
    transition: transform 0.2s;
}

.night-mode-toggle:hover,
.profile-icon:hover {
    transform: scale(1.1);
}

/* Main Content */
.main-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

/* Status Section */
.status-section {
    margin-bottom: 1rem;
}

.online-status-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-info h2 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.status-info p {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--success-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Earnings Highlight */
.earnings-highlight {
    margin-bottom: 1rem;
}

.earnings-card {
    background: linear-gradient(135deg, var(--success-color) 0%, var(--warning-color) 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.earnings-card i {
    font-size: 2.5rem;
}

.earnings-info .label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.earnings-info h1 {
    font-size: 2.5rem;
    font-weight: bold;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.stat-card i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* System Status */
.system-status {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.status-item i {
    font-size: 1.5rem;
}

.status-item.good i {
    color: var(--success-color);
}

.status-item.warning i {
    color: var(--warning-color);
}

.status-item.danger i {
    color: var(--danger-color);
}

/* Fatigue Alert */
.fatigue-alert {
    background: var(--warning-color);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.fatigue-alert i {
    font-size: 2rem;
}

.fatigue-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.fatigue-info p {
    font-size: 0.9rem;
}

/* Current Ride */
.current-ride {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.current-ride h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.ride-card {
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 1rem;
}

.ride-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.ride-id {
    font-weight: bold;
    color: var(--primary-color);
}

.ride-status {
    background: var(--info-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.ride-details {
    margin-bottom: 1rem;
}

.location {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-color);
    border-radius: 6px;
}

.location i {
    font-size: 0.75rem;
}

.location i.pickup {
    color: var(--success-color);
}

.location i.destination {
    color: var(--danger-color);
}

.ride-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.btn-navigate,
.btn-complete {
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.2s;
}

.btn-navigate {
    background: var(--info-color);
    color: white;
}

.btn-complete {
    background: var(--success-color);
    color: white;
}

.btn-navigate:active,
.btn-complete:active {
    transform: scale(0.95);
}

/* Ride Request Modal */
.ride-request-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.request-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.request-content h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.request-timer {
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    color: var(--danger-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.request-details {
    margin-bottom: 1.5rem;
}

.request-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.request-item i {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.request-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-reject,
.btn-accept {
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.2s;
}

.btn-reject {
    background: var(--danger-color);
    color: white;
}

.btn-accept {
    background: var(--success-color);
    color: white;
}

.btn-reject:active,
.btn-accept:active {
    transform: scale(0.95);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.feature-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:active {
    transform: translateY(2px);
}

.feature-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.feature-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-status,
.feature-balance,
.feature-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.feature-status {
    font-weight: 600;
}

/* SOS Button */
.sos-button {
    position: fixed;
    bottom: 100px;
    right: 1rem;
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 99;
    animation: sosGlow 2s infinite;
}

@keyframes sosGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 40px rgba(239, 68, 68, 0.8); }
}

.sos-button:active {
    transform: scale(0.95);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0;
    z-index: 100;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: color 0.2s;
    font-size: 0.85rem;
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item.active {
    color: var(--primary-color);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-color);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* File Upload */
.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.file-upload:hover {
    border-color: var(--primary-color);
}

.file-upload i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.file-upload input[type="file"] {
    display: none;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-primary:active,
.btn-secondary:active,
.btn-success:active,
.btn-danger:active {
    transform: scale(0.95);
}

/* Alert/Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #fff8ec;
    color: #080c12;
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        display: flex;
        align-items: center;
        gap: 1rem;
        text-align: left;
    }
}

/* Touch Optimization */
@media (hover: none) {
    .feature-card:hover {
        transform: none;
    }
    
    .feature-card:active {
        transform: scale(0.95);
        background: var(--bg-color);
    }
}
