/* Public Collection Styles */

body {
    background-color: var(--background-color);
}

.public-collection {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.collection-hero {
    text-align: center;
    padding: 3rem 2rem;
    margin-bottom: 3rem;
    background: linear-gradient(145deg,
            color-mix(in srgb, var(--primary-color) 20%, transparent),
            color-mix(in srgb, var(--secondary-color) 10%, transparent));
    border-radius: 1.5rem;
    border: 1px solid color-mix(in srgb, var(--primary-color) 30%, transparent);
}

.collection-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.collection-hero p {
    color: #cbd5e1;
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

.collection-type-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 9999px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.collection-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.stat-label {
    color: #cbd5e1;
    font-size: 0.9rem;
}

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

.item-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.item-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.item-image {
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    overflow: hidden;
}

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

.item-info {
    padding: 1.25rem;
}

.item-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #fff;
}

.item-code {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 0.2rem 0.6rem;
    border-radius: 0.4rem;
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #fff;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: #cbd5e1;
    font-size: 0.85rem;
}

.item-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.condition-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.condition-sealed {
    background: #10b981;
    color: #fff;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.condition-mint {
    background: #10b981;
    color: #fff;
}

.condition-excellent {
    background: #22c55e;
    color: #fff;
}

.condition-good {
    background: #84cc16;
    color: #000;
}

.condition-fair {
    background: #eab308;
    color: #000;
}

.condition-poor {
    background: #ef4444;
    color: #fff;
}

.empty-collection {
    text-align: center;
    padding: 4rem 2rem;
    color: #64748b;
}

.empty-collection .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Global Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1.75rem;
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    border: 1px solid transparent;
    line-height: 1.5;
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    border-radius: 0.6rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Image Carousel Modal */
.carousel-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    padding: 2rem;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.carousel-modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    max-width: 1200px;
    width: 100%;
    margin: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-layout {
    display: flex;
    min-height: 500px;
}

/* Media Side */
.modal-media {
    flex: 1.2;
    background: #000;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 2rem;
    min-width: 0;
}

.carousel-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    gap: 1rem;
}

.carousel-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
}

.carousel-image {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 8px;
}

.carousel-nav {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.carousel-nav:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.carousel-nav:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.carousel-counter {
    text-align: center;
    color: #94a3b8;
    font-size: 0.875rem;
    margin: 1rem 0;
}

.carousel-thumbnails {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    overflow-x: auto;
    padding: 0.5rem;
    scrollbar-width: thin;
}

.carousel-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.5rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    opacity: 0.6;
}

.carousel-thumbnail:hover {
    opacity: 1;
}

.carousel-thumbnail.active {
    border-color: var(--primary-color);
    opacity: 1;
}

/* Info Side */
.modal-info {
    flex: 0.8;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    background: #0f172a;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    font-size: 2rem;
    color: #fff;
    margin: 0.5rem 0;
    line-height: 1.2;
}

.modal-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.detail-field label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.detail-field .value {
    color: #f1f5f9;
    font-weight: 500;
}

.modal-description label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.modal-description .text {
    color: #cbd5e1;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 0.95rem;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    z-index: 10;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

@media (max-width: 1024px) {
    .modal-layout {
        flex-direction: column;
    }

    .modal-info {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .carousel-nav.prev {
        left: 10px;
        position: absolute;
    }

    .carousel-nav.next {
        right: 10px;
        position: absolute;
    }
}

.item-image-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 768px) {
    .public-collection {
        padding: 1rem;
    }

    .carousel-modal {
        padding: 0;
    }

    .modal-content {
        border-radius: 0;
        min-height: 100vh;
    }
}

/* Filters */
.collection-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-main {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.filter-main input {
    padding-right: 2.5rem;
    width: 100%;
}

.filter-main .search-icon {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

.year-range {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.year-range input {
    width: 90px !important;
}

.year-range span {
    color: rgba(255, 255, 255, 0.4);
}

.collection-filters select,
.collection-filters input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.collection-filters select:focus,
.collection-filters input:focus {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.3);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}