/**
 * Sakay Na - Main Stylesheet
 * Real-Time Location-Based Ride Alert System
 */

/* === Root Variables === */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--dark-color);
    line-height: 1.6;
}

/* === Authentication Pages === */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-page .card {
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.brand-title {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

/* === Buttons === */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

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

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

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}

/* === Forms === */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    padding: 10px 15px;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* === Cards === */
.card {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: none;
    margin-bottom: 20px;
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
}

/* === Map Container === */
#map {
    height: 100%;
    width: 100%;
    border-radius: var(--border-radius);
}

.map-container {
    height: calc(100vh - 200px);
    min-height: 500px;
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

/* === Status Badges === */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.status-badge.online {
    background-color: var(--success-color);
    color: white;
}

.status-badge.offline {
    background-color: #6b7280;
    color: white;
}

.status-badge.busy {
    background-color: var(--warning-color);
    color: white;
}

/* === Rating Stars === */
.rating-stars {
    color: #fbbf24;
    font-size: 1.1rem;
}

.rating-stars .empty {
    color: #d1d5db;
}

/* === Vehicle Icons === */
.vehicle-icon {
    font-size: 2rem;
    display: inline-block;
}

/* === Emergency Button === */
.emergency-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    animation: pulse 2s infinite;
}

.emergency-btn:hover {
    background-color: #dc2626;
    transform: scale(1.05);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(239, 68, 68, 0.8);
    }
}

/* === Status Toggle Button === */
.status-toggle {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.status-toggle.active {
    background-color: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.status-toggle.inactive {
    background-color: #6b7280;
    color: white;
    border-color: #6b7280;
}

.status-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* === Notification Badge === */
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* === Loading Spinner === */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

/* === Info Window === */
.info-window {
    font-family: inherit;
    max-width: 250px;
}

.info-window h6 {
    margin-bottom: 8px;
    color: var(--primary-color);
    font-weight: bold;
}

.info-window p {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.info-window .btn {
    margin-top: 10px;
    width: 100%;
}

/* === Sidebar === */
.sidebar {
    background: white;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link {
    color: var(--dark-color);
    padding: 15px 20px;
    border-radius: 8px;
    margin: 5px 10px;
    transition: var(--transition);
}

.sidebar .nav-link:hover {
    background-color: var(--light-color);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

/* === Table Styles === */
.table {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead {
    background-color: var(--light-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* === Badge Styles === */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* === QR Code Container === */
.qr-code-container {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.qr-code-container img {
    max-width: 300px;
    height: auto;
    border: 3px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 10px;
}

/* === Responsive === */
@media (max-width: 768px) {
    .brand-title {
        font-size: 2rem;
    }
    
    .emergency-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .map-container {
        height: calc(100vh - 250px);
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 80%;
        transition: var(--transition);
        z-index: 1000;
    }
    
    .sidebar.show {
        left: 0;
    }
}

@media (max-width: 576px) {
    .status-toggle {
        font-size: 1rem;
        padding: 12px;
    }
}

/* === Utility Classes === */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.shadow-custom {
    box-shadow: var(--box-shadow);
}

/* === Animations === */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

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