/* Coupang Eats Dashboard - Mobile-first styles */

/* Safe area for notched phones */
.safe-area-top { padding-top: env(safe-area-inset-top, 0); }
.safe-area-bottom { padding-bottom: env(safe-area-inset-bottom, 0); }

/* Metric cards */
.metric-card {
    background: white;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.metric-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}
.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}
.metric-sub {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 0.125rem;
}

/* Bottom tab bar */
.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.25rem 0.75rem;
    color: #9ca3af;
    font-weight: 500;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.tab-btn.active {
    color: #1e40af;
}

/* Sub-tabs */
.sub-tab {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    border-radius: 0.5rem;
    white-space: nowrap;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.sub-tab.active {
    color: white;
    background: rgba(255,255,255,0.15);
    font-weight: 600;
}

/* Rider performance table */
#rider-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}
#rider-table td, #rider-table th {
    min-width: 45px;
}
#rider-table td:nth-child(2),
#rider-table th:nth-child(2) {
    min-width: 60px;
}
#rider-table td:nth-child(3),
#rider-table th:nth-child(3) {
    min-width: 90px;
}

/* Mission card */
.mission-card {
    background: white;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.mission-title {
    font-weight: 600;
    font-size: 0.9rem;
}
.mission-detail {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Mission expandable accordion */
.mission-toggle {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mission-expand-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.2s ease-out;
    opacity: 0;
}
.mission-expand-content.open {
    max-height: 500px;
    opacity: 1;
    transition: max-height 0.4s ease-in, opacity 0.3s ease-in;
}
.mission-chevron {
    transition: transform 0.3s ease;
    display: inline-block;
}
.mission-chevron.open {
    transform: rotate(180deg);
}
.mission-desc {
    font-size: 0.72rem;
    color: #6b7280;
    line-height: 1.6;
    white-space: pre-wrap;
    padding: 0.5rem 0;
    border-top: 1px solid #f3f4f6;
    margin-top: 0.5rem;
}

/* Change log item */
.change-item {
    padding: 0.625rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.change-field {
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
}
.change-values {
    font-size: 0.75rem;
    color: #6b7280;
}
.change-time {
    font-size: 0.65rem;
    color: #9ca3af;
    white-space: nowrap;
    margin-left: 0.5rem;
}

/* Settlement item */
.settlement-item {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Peak time row styling */
.peak-row {
    transition: background-color 0.15s;
}
.peak-row:active {
    background-color: #f3f4f6;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #1e40af;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* Prevent text selection on interactive elements */
.tab-btn, .sub-tab, button, .mission-toggle {
    -webkit-user-select: none;
    user-select: none;
}

/* Weekly daily card */
.daily-card {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.daily-card:active {
    background-color: #f9fafb;
}

/* Reward history */
.reward-history-item {
    border-bottom: 1px solid #f3f4f6;
}
.reward-history-item:last-child {
    border-bottom: none;
}

/* Badge progress bar */
.badge-track {
    position: relative;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: visible;
}
.badge-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Standalone mode adjustments (when installed as PWA) */
@media (display-mode: standalone) {
    #install-banner { display: none !important; }
}
