/**
 * Collection Page Styles
 * Version: 1.0.0
 * V21 Design System - Navy & Gold
 */

/* ========================================
   COLLECTION PAGE LAYOUT
   ======================================== */

.collection-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.collection-page.content-section {
    display: none;
}

.collection-page.content-section.active {
    display: block;
}

/* ========================================
   HEADER
   ======================================== */

.collection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gold);
}

.collection-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--gold);
    border-radius: var(--radius-lg);
    color: var(--gold);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.collection-back-btn:hover {
    background: var(--gold);
    color: var(--dark-navy);
    transform: translateX(-4px);
}

.collection-back-btn svg {
    flex-shrink: 0;
}

.collection-title {
    font-size: 2.5em;
    color: var(--bright-gold);
    margin: 0;
    text-align: center;
    flex: 1;
}

.collection-actions {
    display: flex;
    gap: 10px;
}

.collection-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--gold);
    border: none;
    border-radius: var(--radius-lg);
    color: var(--dark-navy);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.collection-action-btn:hover {
    background: var(--bright-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
}

.collection-action-btn svg {
    flex-shrink: 0;
}

/* ========================================
   STATISTICS BAR
   ======================================== */

.collection-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--navy), var(--dark-navy));
    border: 1px solid var(--gold);
    border-radius: var(--radius-xl);
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(212, 165, 116, 0.2);
    border-color: var(--bright-gold);
}

.stat-label {
    font-size: 0.9em;
    color: var(--cream);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: var(--bright-gold);
}

/* ========================================
   TAB NAVIGATION
   ======================================== */

.collection-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--gold);
}

.collection-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--cream);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.collection-tab:hover {
    opacity: 1;
    background: rgba(212, 165, 116, 0.1);
}

.collection-tab.active {
    opacity: 1;
    color: var(--bright-gold);
    border-bottom-color: var(--bright-gold);
}

.collection-tab svg {
    flex-shrink: 0;
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--gold);
    color: var(--dark-navy);
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-xl);
}

.collection-tab.active .tab-count {
    background: var(--bright-gold);
}

/* ========================================
   LAYOUT GRID
   ======================================== */

.collection-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

/* ========================================
   SIDEBAR
   ======================================== */

.collection-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 100px; /* Account for header/nav */
    max-height: calc(100vh - 200px); /* Account for header and footer */
    overflow-y: auto;
    overflow-x: hidden;
    align-self: flex-start;
    padding-bottom: 20px;
}

/* Custom scrollbar for sidebar */
.collection-sidebar::-webkit-scrollbar {
    width: 6px;
}

.collection-sidebar::-webkit-scrollbar-track {
    background: rgba(212, 165, 116, 0.1);
    border-radius: var(--radius-sm);
}

.collection-sidebar::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: var(--radius-sm);
}

.collection-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--cream);
}

.sidebar-section {
    background: var(--navy);
    border: 1px solid var(--gold);
    border-radius: var(--radius-xl);
    padding: 20px;
}

.sidebar-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.sidebar-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

/* Search Input */
.collection-search-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--dark-navy);
    border: 1px solid var(--gold);
    border-radius: var(--radius-lg);
    color: var(--cream);
    font-size: 14px;
    transition: all 0.3s ease;
}

.collection-search-input:focus {
    outline: none;
    border-color: var(--bright-gold);
    box-shadow: 0 0 0 3px rgba(244, 196, 48, 0.1);
}

.collection-search-input::placeholder {
    color: var(--cream);
    opacity: 0.5;
}

/* View Mode Selector */
.view-mode-selector {
    display: flex;
    gap: 8px;
}

.view-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: var(--dark-navy);
    border: 1px solid var(--gold);
    border-radius: var(--radius-lg);
    color: var(--cream);
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-mode-btn:hover {
    background: var(--navy);
    border-color: var(--bright-gold);
}

.view-mode-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--dark-navy);
}

.view-mode-btn svg {
    flex-shrink: 0;
}

/* Select Dropdown */
.collection-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--dark-navy);
    border: 1px solid var(--gold);
    border-radius: var(--radius-lg);
    color: var(--cream);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.collection-select:focus {
    outline: none;
    border-color: var(--bright-gold);
    box-shadow: 0 0 0 3px rgba(244, 196, 48, 0.1);
}

.collection-select option {
    background: var(--dark-navy);
    color: var(--cream);
}

/* Filters */
.clear-filters-btn {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--gold);
    border-radius: var(--radius-sm);
    color: var(--gold);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-filters-btn:hover {
    background: var(--gold);
    color: var(--dark-navy);
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    display: block;
    font-size: 13px;
    color: var(--cream);
    margin-bottom: 8px;
    opacity: 0.9;
}

.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    color: var(--cream);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-checkbox-label:hover {
    color: var(--bright-gold);
}

.filter-checkbox,
.filter-condition {
    width: 16px;
    height: 16px;
    border: 1px solid var(--gold);
    border-radius: var(--radius-sm);
    cursor: pointer;
    accent-color: var(--gold);
}

.add-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gold);
    border: none;
    border-radius: 50%;
    color: var(--dark-navy);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-btn:hover {
    background: var(--bright-gold);
    transform: rotate(90deg);
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */

.collection-main {
    min-height: 400px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========================================
   COLLECTION GRID
   ======================================== */

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* List View */
.collection-grid.view-list {
    grid-template-columns: 1fr;
}

/* Compact View */
.collection-grid.view-compact {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

/* ========================================
   MODEL CARD (Collection Version)
   ======================================== */

.collection-model-card {
    background: linear-gradient(135deg, var(--navy), var(--dark-navy));
    border: 1px solid var(--gold);
    border-radius: var(--radius-xl);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.collection-model-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(212, 165, 116, 0.3);
    border-color: var(--bright-gold);
}

.collection-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-lg);
    background: var(--dark-navy);
    overflow: hidden;
}

.collection-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.collection-card-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.collection-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--bright-gold);
    line-height: 1.3;
}

.collection-card-make {
    font-size: 14px;
    color: var(--cream);
    opacity: 0.8;
}

.collection-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.collection-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(212, 165, 116, 0.15);
    border: 1px solid var(--gold);
    border-radius: var(--radius-xl);
    font-size: 12px;
    color: var(--gold);
}

/* Condition Badge Colors */
.collection-card-badge.condition-mint {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    color: #22c55e;
}

.collection-card-badge.condition-near-mint {
    background: rgba(132, 204, 22, 0.15);
    border-color: #84cc16;
    color: #84cc16;
}

.collection-card-badge.condition-good {
    background: rgba(234, 179, 8, 0.15);
    border-color: #eab308;
    color: #eab308;
}

.collection-card-badge.condition-fair {
    background: rgba(249, 115, 22, 0.15);
    border-color: #f97316;
    color: #f97316;
}

.collection-card-badge.condition-poor {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #ef4444;
}

.collection-card-rating {
    display: flex;
    gap: 2px;
}

.star {
    color: var(--bright-gold);
    font-size: 14px;
}

.star-filled {
    opacity: 1;
}

.star-empty {
    opacity: 0.3;
}

.collection-card-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--gold);
    margin-top: 4px;
}

.collection-card-brand {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gold);
    opacity: 0.7;
}

.collection-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(212, 165, 116, 0.2);
}

.card-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--gold);
    border-radius: var(--radius-md);
    color: var(--gold);
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-action-btn:hover {
    background: var(--gold);
    color: var(--dark-navy);
    transform: translateY(-2px);
}

.card-action-btn svg {
    width: 16px;
    height: 16px;
}

.card-action-btn.remove-btn {
    border-color: #ef4444;
    color: #ef4444;
}

.card-action-btn.remove-btn:hover {
    background: #ef4444;
    color: white;
}

/* Badge variants for priority/status */
.collection-card-badge.badge-error {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #ef4444;
}

.collection-card-badge.badge-warning {
    background: rgba(234, 179, 8, 0.15);
    border-color: #eab308;
    color: #eab308;
}

.collection-card-badge.badge-success {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    color: #22c55e;
}

.collection-card-badge.badge-info {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #3b82f6;
}

.collection-card-btn.btn-remove:hover {
    background: #ef4444;
    color: white;
}

/* ========================================
   EMPTY STATES
   ======================================== */

.collection-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 60px 20px;
    text-align: center;
}

.collection-empty svg {
    color: var(--gold);
    opacity: 0.5;
}

.collection-empty h3 {
    font-size: 24px;
    color: var(--bright-gold);
    margin: 0;
}

.collection-empty p {
    font-size: 16px;
    color: var(--cream);
    opacity: 0.8;
    margin: 0;
}

.collection-primary-btn {
    padding: 12px 28px;
    background: var(--gold);
    border: none;
    border-radius: var(--radius-lg);
    color: var(--dark-navy);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.collection-primary-btn:hover {
    background: var(--bright-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .collection-layout {
        grid-template-columns: 1fr;
    }

    .collection-sidebar {
        order: 2;
    }

    .collection-main {
        order: 1;
    }
}

@media (max-width: 768px) {
    .collection-page {
        padding: 15px;
    }

    .collection-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .collection-title {
        font-size: 2em;
        text-align: left;
    }

    .collection-actions {
        justify-content: flex-end;
    }

    .collection-stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .collection-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .collection-tab {
        white-space: nowrap;
        padding: 10px 16px;
        font-size: 14px;
    }

    .collection-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .collection-grid.view-compact {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .collection-title {
        font-size: 1.5em;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-value {
        font-size: 1.5em;
    }

    .collection-stats-bar {
        grid-template-columns: 1fr;
    }

    .collection-back-btn span {
        display: none;
    }

    .collection-action-btn span {
        display: none;
    }

    .collection-grid.view-compact {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   ANIMATIONS
   Use keyframes from utilities.css: fadeIn, slideUp, pulse
   ======================================== */

.collection-model-card {
    animation: fadeIn 0.3s ease;
}

@keyframes countUp {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.stat-value {
    animation: countUp 0.5s ease;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .collection-sidebar,
    .collection-header,
    .collection-tabs,
    .collection-card-actions {
        display: none !important;
    }

    .collection-layout {
        grid-template-columns: 1fr;
    }

    .collection-model-card {
        break-inside: avoid;
    }
}
