/* Vehicle Detail Sidebar - Dark Theme for VINSnap */

/* Main sidebar container */
.vehicle-detail-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(14, 22, 36, 0.95);
    border: 1px solid rgba(59, 130, 246, 0.12);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* Tab navigation */
.vehicle-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(59, 130, 246, 0.12);
    background: rgba(9, 15, 27, 0.6);
    padding: 0;
}

.vehicle-tab {
    flex: 1;
    padding: 14px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vehicle-tab:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--text-primary);
}

.vehicle-tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
}

/* Tab content */
.vehicle-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: rgba(14, 22, 36, 0.5);
    box-sizing: border-box;
}

.vehicle-tab-content.active {
    display: block;
}

.vehicle-tab-content::-webkit-scrollbar {
    width: 6px;
}

.vehicle-tab-content::-webkit-scrollbar-track {
    background: transparent;
}

.vehicle-tab-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.vehicle-tab-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Overview Tab */
.overview-tab {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.tab-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 2rem;
    gap: 1.25rem;
}

.tab-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    width: 100%;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.header-actions .btn-sm {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    min-width: 160px;
}

.header-actions .btn-sm::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.header-actions .btn-sm:hover::before {
    width: 300px;
    height: 300px;
}

.header-actions .btn-secondary {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.85) 100%);
    border: 2px solid rgba(139, 92, 246, 0.25);
    color: #a78bfa;
    border-radius: 12px;
    font-weight: 600;
}

.header-actions .btn-secondary:hover {
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.15) 0%, rgba(59, 130, 246, 0.12) 100%);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
    color: #c4b5fd;
}

.header-actions .btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
    border: 2px solid rgba(139, 92, 246, 0.3);
    color: white;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4),
                0 0 40px rgba(139, 92, 246, 0.15);
}

.header-actions .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(139, 92, 246, 0.5),
                0 0 50px rgba(139, 92, 246, 0.2);
}

/* Mobile optimization for header actions */
@media (max-width: 768px) {
    .tab-header {
        margin-bottom: 1.5rem;
        gap: 1rem;
    }

    .tab-title {
        font-size: 1.25rem;
    }

    .header-actions {
        gap: 0.5rem;
        flex-direction: column;
    }

    .header-actions .btn-sm {
        width: 100%;
        min-width: 0;
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }

    /* Stack buttons vertically on very small screens */
    @media (max-width: 480px) {
        .header-actions {
            flex-direction: column;
        }

        .header-actions .btn-sm {
            width: 100%;
            font-size: 0.8125rem;
            padding: 0.625rem 0.75rem;
        }
    }
}

.overview-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-card-compact {
    padding: 14px;
    background: rgba(9, 15, 27, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.2s ease;
}

.stat-card-compact:hover {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(9, 15, 27, 0.95);
    transform: translateY(-1px);
}

.stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-value-money {
    color: var(--accent-green);
}

.stat-value-danger {
    color: var(--accent-red);
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: rgba(9, 15, 27, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.action-icon {
    font-size: 28px;
}

.action-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Activity Timeline */
.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(9, 15, 27, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.08);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.activity-item:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

.activity-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.activity-date {
    font-size: 11px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.activity-empty,
.activity-error {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Service Tab */
.service-tab {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.service-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.service-timeline {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.timeline-month-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-month {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.timeline-records {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-record-card {
    background: rgba(9, 15, 27, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.service-record-card:hover {
    border-color: var(--accent-blue);
    background: rgba(9, 15, 27, 0.95);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.service-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
}

.service-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.service-main {
    flex: 1;
    min-width: 0;
}

.service-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.service-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.service-cost {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-green);
    flex-shrink: 0;
}

.service-card-body {
    padding: 0 14px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-provider {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.service-notes {
    font-size: 12px;
    color: var(--text-primary);
    margin: 0;
    padding: 10px;
    background: rgba(9, 15, 27, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.08);
    border-radius: 6px;
}

.service-card-actions {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid rgba(59, 130, 246, 0.08);
}

.timeline-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 50px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 56px;
    opacity: 0.3;
}

.timeline-empty h4 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

.timeline-empty p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 300px;
}

/* Reminders Tab */
.reminders-tab {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reminder-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.reminder-filter-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.12);
    margin-bottom: -8px;
}

.filter-tab {
    padding: 10px 14px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-tab:hover {
    color: var(--text-primary);
}

.filter-tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.reminders-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reminder-priority-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reminder-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.reminder-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reminder-card {
    background: rgba(9, 15, 27, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.reminder-card:hover {
    border-color: var(--accent-blue);
    background: rgba(9, 15, 27, 0.95);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.reminder-card.reminder-overdue {
    border-color: var(--accent-red);
    background: rgba(248, 113, 113, 0.05);
}

.reminder-priority-high {
    border-left: 3px solid var(--accent-red);
}

.reminder-priority-medium {
    border-left: 3px solid var(--accent-yellow);
}

.reminder-priority-low {
    border-left: 3px solid var(--accent-blue);
}

.reminder-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
}

.reminder-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.reminder-main {
    flex: 1;
    min-width: 0;
}

.reminder-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.reminder-due {
    font-size: 12px;
    color: var(--text-secondary);
}

.reminder-priority-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    flex-shrink: 0;
}

.badge-high {
    background: rgba(248, 113, 113, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.badge-medium {
    background: rgba(250, 204, 21, 0.15);
    color: var(--accent-yellow);
    border: 1px solid rgba(250, 204, 21, 0.3);
}

.badge-low {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.reminder-body {
    padding: 0 14px 14px 14px;
}

.reminder-description {
    font-size: 12px;
    color: var(--text-primary);
    margin: 0;
    padding: 10px;
    background: rgba(9, 15, 27, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.08);
    border-radius: 6px;
}

.reminder-actions {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid rgba(59, 130, 246, 0.08);
}

.reminders-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 50px 20px;
    text-align: center;
}

.reminders-empty h4 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

.reminders-empty p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 300px;
}

/* Button Styles */
.btn-sm {
    padding: 8px 14px;
    font-size: 11px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: rgba(9, 15, 27, 0.8);
    color: var(--text-primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.btn-secondary:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--accent-blue);
}

.btn-success {
    background: var(--accent-green);
    color: var(--primary-bg);
    border: 1px solid rgba(34, 211, 166, 0.3);
}

.btn-success:hover {
    background: rgba(34, 211, 166, 0.9);
    box-shadow: 0 6px 16px rgba(34, 211, 166, 0.3);
}

.btn-text {
    background: none;
    color: var(--accent-blue);
    padding: 6px 10px;
    font-size: 11px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-text:hover {
    background: rgba(59, 130, 246, 0.12);
    border-radius: 6px;
}

.btn-text-danger {
    color: var(--accent-red);
}

.btn-text-danger:hover {
    background: rgba(248, 113, 113, 0.12);
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Ensure sidebar fills available width on mobile */
    .vehicle-detail-sidebar {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Increase padding on mobile for better spacing */
    .vehicle-tab-content {
        padding: 16px;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .vehicle-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .vehicle-tab {
        flex: 0 0 auto;
        min-width: 100px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .action-buttons {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .service-stats,
    .reminder-stats {
        grid-template-columns: 1fr;
        width: 100%;
    }

    /* Prevent any card content from exceeding container */
    .stat-card-compact,
    .action-btn,
    .service-record-card,
    .reminder-card {
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    /* Further reduce horizontal padding on ultra-small screens */
    .vehicle-tab-content {
        padding: 12px 8px;
    }

    .stat-value {
        font-size: 20px;
    }

    .action-icon {
        font-size: 24px;
    }

    .action-label {
        font-size: 10px;
    }
}
