/* assets/css/app.css */

:root {
    --primary: #E31B23;
    --primary-dark: #B0171D;
    --secondary: #1565C0;
    --dark: #101828;
    --white: #FFFFFF;
    --light: #F7F8FA;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --radius: 16px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--light);
    color: var(--dark);
    padding-bottom: 80px;
}

/* Header */
.app-header {
    background: var(--white);
    padding: 1rem 1rem 0.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.greeting {
    font-size: 1.1rem;
    font-weight: 600;
}

.sub-greeting {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-icon {
    background: none;
    border: none;
    position: relative;
    font-size: 1.25rem;
    color: var(--gray-600);
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
    cursor: pointer;
}

.btn-icon:hover {
    background: var(--gray-100);
}

.badge-notif {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: #fff;
    font-size: 0.625rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Container */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    margin-bottom: 1rem;
    border: none;
}

/* Location Card */
.location-card .location-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.location-card .address {
    font-weight: 500;
    font-size: 0.9rem;
    flex: 1;
}

.location-card .label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.btn-change-location {
    background: var(--gray-100);
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--gray-600);
    cursor: pointer;
}

/* Wallet Card */
.wallet-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
}

.wallet-card .wallet-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wallet-card .label {
    font-size: 0.75rem;
    opacity: 0.8;
}

.wallet-card .balance {
    font-size: 1.5rem;
    font-weight: 700;
}

.btn-topup {
    background: rgba(255,255,255,0.2);
    border: none;
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-topup:hover {
    background: rgba(255,255,255,0.3);
}

.wallet-points {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    opacity: 0.9;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
}

.service-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: transform 0.2s;
}

.service-item:active {
    transform: scale(0.95);
}

.service-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.25rem;
}

.service-item span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-600);
}

/* Promo Banner */
.promo-banner {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.promo-banner::before {
    content: '';
    position: absolute;
    right: -50px;
    top: -50px;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.promo-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

.promo-banner h3 {
    font-size: 1.25rem;
    margin: 0.25rem 0;
}

.promo-discount {
    font-size: 2rem;
    font-weight: 700;
}

.promo-banner p {
    opacity: 0.9;
    margin: 0.25rem 0;
}

.btn-promo {
    color: var(--primary);
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    border: none;
    margin-top: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-promo:active {
    transform: scale(0.95);
}

.promo-image {
    font-size: 2rem;
    opacity: 0.5;
}

/* Section Title */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0 0.75rem;
}

.section-title h4 {
    font-size: 1.1rem;
    font-weight: 600;
}

.section-title a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Order Card */
.order-card {
    padding: 1rem;
}

.order-card .order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.order-type {
    font-weight: 600;
    font-size: 0.875rem;
}

.order-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.status-pending { background: #FFF3CD; color: #856404; }
.status-searching { background: #CCE5FF; color: #004085; }
.status-accepted { background: #D4EDDA; color: #155724; }
.status-arrived { background: #D1ECF1; color: #0C5460; }
.status-in_progress { background: #D4EDDA; color: #155724; }
.status-completed { background: #D4EDDA; color: #155724; }
.status-cancelled { background: #F8D7DA; color: #721C24; }

.order-details {
    margin: 0.5rem 0;
}

.order-details .pickup,
.order-details .destination {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

.order-details .pickup i {
    color: var(--success);
    margin-top: 0.2rem;
}

.order-details .destination i {
    color: var(--danger);
    margin-top: 0.2rem;
}

.driver-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-100);
    border-radius: var(--radius);
    margin: 0.75rem 0;
}

.driver-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.driver-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.driver-rating {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.driver-vehicle {
    margin-left: 0.5rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--gray-300);
}

.driver-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.btn-block {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius);
    border: none;
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-block:active {
    opacity: 0.8;
}

/* Transaction List */
.transaction-list {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1rem;
    margin-right: 0.75rem;
}

.transaction-info {
    flex: 1;
}

.transaction-name {
    font-weight: 500;
    font-size: 0.875rem;
}

.transaction-date {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.transaction-amount {
    font-weight: 600;
    font-size: 0.875rem;
}

.transaction-amount.positive {
    color: var(--success);
}

.transaction-amount.negative {
    color: var(--danger);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    z-index: 1000;
    max-width: 480px;
    margin: 0 auto;
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    padding: 0.25rem 1rem;
    position: relative;
    text-decoration: none;
    color: var(--gray-500);
    transition: color 0.2s;
    border: none;
    background: none;
}

.bottom-nav .nav-item i {
    font-size: 1.25rem;
}

.bottom-nav .nav-item span {
    font-size: 0.625rem;
}

.bottom-nav .nav-item.active {
    color: var(--primary);
}

.bottom-nav .nav-item .badge {
    position: absolute;
    top: 0;
    right: 0.25rem;
    background: var(--danger);
    color: var(--white);
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 50%;
    min-width: 18px;
    text-align: center;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 480px;
    width: 90%;
}

.toast {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideDown 0.3s ease;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info { border-left: 4px solid var(--info); }

.toast i {
    font-size: 1.5rem;
}

.toast-success i { color: var(--success); }
.toast-error i { color: var(--danger); }
.toast-warning i { color: var(--warning); }
.toast-info i { color: var(--info); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.toast-message {
    font-size: 0.813rem;
    color: var(--gray-600);
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--gray-400);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 480px) {
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .service-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .promo-banner {
        padding: 1rem;
    }
    
    .promo-discount {
        font-size: 1.5rem;
    }
}

@media (min-width: 481px) {
    body {
        max-width: 480px;
        margin: 0 auto;
        background: var(--gray-100);
    }
    
    .bottom-nav {
        max-width: 480px;
    }
}