/* ===== COLLECTION PAGE STYLES ===== */
/* These styles extend domus.css for the coin collection page */

/* Collection Controls */
.collection-controls {
    margin-bottom: 30px;
}

.filter-sort-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--card-border-radius);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.btn-filter {
    padding: 10px 20px;
    background: var(--gradient-primary);
    color: #000;
    font-weight: 700;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-speed);
}

.btn-filter:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tag {
    background: rgba(255, 204, 0, 0.1);
    color: var(--light-color);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 204, 0, 0.2);
    transition: all var(--transition-speed);
}

.filter-tag:hover {
    background: rgba(255, 204, 0, 0.2);
}

.filter-tag i {
    cursor: pointer;
    font-size: 10px;
    color: var(--primary-color);
    transition: all var(--transition-speed);
}

.filter-tag i:hover {
    transform: scale(1.2);
}

.view-sort-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.view-toggles {
    display: flex;
    gap: 10px;
}

.btn-view-toggle {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-view-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--light-color);
}

.btn-view-toggle.active {
    background: rgba(255, 204, 0, 0.1);
    color: var(--primary-color);
    border-color: rgba(255, 204, 0, 0.3);
}

.sort-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-dropdown label {
    font-size: 14px;
    color: #aaa;
}

.sort-dropdown select {
    background: rgba(0, 0, 0, 0.3);
    color: var(--light-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    transition: all var(--transition-speed);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffcc00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 30px;
}

.sort-dropdown select:hover,
.sort-dropdown select:focus {
    border-color: rgba(255, 204, 0, 0.3);
    box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.1);
}

.collection-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #aaa;
    font-size: 14px;
}

.stat-pill i {
    color: var(--primary-color);
}

.stat-pill span {
    font-weight: 700;
    color: var(--light-color);
}

.btn-add-coin {
    margin-left: auto;
    padding: 10px 20px;
    background: var(--gradient-primary);
    color: #000;
    font-weight: 700;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-speed);
}

.btn-add-coin:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

/* Filter Panel */
.filter-panel {
    background: rgba(0, 0, 0, 0.9);
    border-radius: var(--card-border-radius);
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--card-shadow);
    display: none;
    animation: slideDown 0.3s ease-out forwards;
}

.filter-panel.visible {
    display: block;
}

.filter-panel h3 {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--primary-color);
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 25px;
}

.filter-column h4 {
    font-size: 16px;
    color: var(--light-color);
    margin-bottom: 15px;
    font-weight: 400;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #aaa;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.filter-options label:hover {
    color: var(--light-color);
}

.filter-options input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.filter-options input[type="checkbox"]:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.filter-options input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 12px;
    font-weight: 700;
}

.filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-clear-filters {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
    border-radius: 25px;
    transition: all var(--transition-speed);
}

.btn-clear-filters:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--light-color);
}

.btn-apply-filters {
    padding: 10px 25px;
    background: var(--gradient-primary);
    color: #000;
    font-weight: 700;
    border-radius: 25px;
    transition: all var(--transition-speed);
}

.btn-apply-filters:hover {
    filter: brightness(var(--hover-brightness));
    transform: translateY(-3px);
}

/* Collection Grid View */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.coin-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--card-border-radius);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
    animation: fadeIn 0.5s ease-out forwards;
    position: relative;
}

.coin-item:hover {
    transform: translateY(-7px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 204, 0, 0.2);
}

.coin-images {
    position: relative;
    height: 200px;
    background: #000;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.coin-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    transition: all 0.4s ease-in-out;
}

.coin-image.reverse {
    opacity: 0;
}

.coin-images:hover .coin-image.obverse {
    opacity: 0;
}

.coin-images:hover .coin-image.reverse {
    opacity: 1;
}

.coin-info {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.coin-info h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--light-color);
    font-weight: 600;
}

.coin-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 14px;
}

.denomination {
    color: #aaa;
}

.year {
    color: var(--primary-color);
}

.coin-quick-data {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.coin-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.coin-condition {
    background: rgba(255, 204, 0, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(255, 204, 0, 0.2);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 14px;
    font-weight: 700;
}

.coin-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
}

.btn-view-coin,
.btn-edit-coin {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
}

.btn-view-coin {
    background: var(--gradient-primary);
    color: #000;
}

.btn-edit-coin {
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
}

.btn-view-coin:hover,
.btn-edit-coin:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-edit-coin:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--light-color);
}

/* Collection List View */
.collection-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.collection-list .coin-item {
    display: flex;
    height: auto;
    max-height: none;
}

.collection-list .coin-images {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.collection-list .coin-info {
    flex: 1;
    border-bottom: none;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.collection-list .coin-actions {
    width: 100px;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.collection-list .coin-quick-data {
    margin-top: auto;
}

/* Loading Placeholders */
.loading-placeholder {
    animation: pulse 1.5s infinite;
}

.coin-images.placeholder {
    background: linear-gradient(90deg, #222 25%, #2a2a2a 50%, #222 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.placeholder-line {
    height: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    background: linear-gradient(90deg, #222 25%, #2a2a2a 50%, #222 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.placeholder-line:nth-child(2) {
    width: 75%;
}

.placeholder-line:nth-child(3) {
    width: 50%;
    margin-bottom: 0;
}

/* Pagination */
.collection-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.page-nav {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
}

.page-nav:hover:not(:disabled) {
    background: rgba(255, 204, 0, 0.1);
    color: var(--primary-color);
    transform: translateX(-3px);
}

.page-nav.next:hover {
    transform: translateX(3px);
}

.page-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-num {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
    font-size: 14px;
}

.page-num:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--light-color);
}

.page-num.active {
    background: var(--gradient-primary);
    color: #000;
    font-weight: 700;
}

.page-ellipsis {
    color: #aaa;
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.page-size-select {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-size-select label {
    font-size: 14px;
    color: #aaa;
}

.page-size-select select {
    background: rgba(0, 0, 0, 0.3);
    color: var(--light-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    transition: all var(--transition-speed);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffcc00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 30px;
}

.page-size-select select:focus {
    border-color: rgba(255, 204, 0, 0.3);
    box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.1);
}

/* Coin Detail Modal */
.coin-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.coin-detail-modal.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #111;
    border-radius: var(--card-border-radius);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    padding: 30px;
    position: relative;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.4s ease;
}

.coin-detail-modal.visible .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 10;
    transition: all var(--transition-speed);
}

.modal-close:hover {
    background: rgba(255, 204, 0, 0.1);
    color: var(--primary-color);
    transform: rotate(90deg);
}

.coin-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.coin-gallery {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-coin-images {
    background: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    text-align: center;
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
}

.thumbnail-gallery {
    display: flex;
    gap: 15px;
    padding: 15px 0;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    cursor: pointer;
    transition: all var(--transition-speed);
    border: 2px solid transparent;
    opacity: 0.7;
}

.thumbnail:hover {
    transform: translateY(-3px);
    opacity: 1;
}

.thumbnail.active {
    border-color: var(--primary-color);
    opacity: 1;
}

.coin-zoom-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-zoom-in,
.btn-zoom-out,
.btn-rotate {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    color: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-zoom-in:hover,
.btn-zoom-out:hover,
.btn-rotate:hover {
    background: rgba(255, 204, 0, 0.1);
    color: var(--primary-color);
    transform: translateY(-3px);
}

.coin-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.coin-details h2 {
    grid-column: span 2;
    font-family: 'Cinzel', serif;
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-group {
    margin-bottom: 15px;
}

.detail-group.full-width {
    grid-column: span 2;
}

.detail-group label {
    font-size: 12px;
    color: #999;
    display: block;
    margin-bottom: 5px;
}

.detail-group p {
    font-size: 16px;
    color: var(--light-color);
}

.detail-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-edit-coin-detail,
.btn-add-to-wishlist,
.btn-print-details {
    padding: 12px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-speed);
}

.btn-edit-coin-detail {
    background: var(--gradient-primary);
    color: #000;
}

.btn-add-to-wishlist {
    background: rgba(255, 255, 255, 0.05);
    color: var(--light-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-print-details {
    background: rgba(255, 255, 255, 0.05);
    color: var(--light-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-edit-coin-detail:hover,
.btn-add-to-wishlist:hover,
.btn-print-details:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-add-to-wishlist:hover,
.btn-print-details:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive Styles for Collection Page */
@media screen and (max-width: 1200px) {
    .coin-detail-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .coin-details {
        order: 2;
    }
    
    .coin-gallery {
        order: 1;
    }
    
    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 992px) {
    .filter-sort-container {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
    
    .view-sort-section {
        width: 100%;
        justify-content: space-between;
    }
    
    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
}

@media screen and (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .collection-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .btn-add-coin {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    
    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .coin-details {
        grid-template-columns: 1fr;
    }
    
    .coin-details h2 {
        grid-column: span 1;
    }
    
    .detail-group.full-width {
        grid-column: span 1;
    }
    
    .collection-pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .page-size-select {
        width: 100%;
        justify-content: center;
        margin-top: 15px;
    }
    
    .detail-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn-edit-coin-detail,
    .btn-add-to-wishlist,
    .btn-print-details {
        width: 100%;
        justify-content: center;
    }
}

@media screen and (max-width: 576px) {
    .filter-section {
        width: 100%;
    }
    
    .btn-filter {
        width: 100%;
        justify-content: center;
    }
    
    .view-toggles {
        margin-right: auto;
    }
    
    .sort-dropdown {
        width: 100%;
        flex-wrap: wrap;
        margin-top: 15px;
    }
    
    .sort-dropdown select {
        width: 100%;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .coin-images {
        height: 160px;
    }
    
    .page-numbers {
        margin: 0 5px;
    }
    
    .page-num {
        width: 35px;
        height: 35px;
        font-size: 13px;
    }
}

/* Dark mode optimizations */
@media (prefers-color-scheme: dark) {
    .main-coin-images {
        background: #000;
    }
    
    .coin-images {
        background: #000;
    }
}

/* Print styles for coin details */
@media print {
    .coin-detail-modal {
        position: relative;
        background: white;
        height: auto;
        overflow: visible;
        display: block;
    }
    
    .modal-content {
        box-shadow: none;
        border: none;
        padding: 0;
    }
    
    .modal-close,
    .coin-zoom-controls,
    .detail-actions {
        display: none;
    }
    
    .coin-detail-layout {
        grid-template-columns: 1fr;
    }
    
    .coin-details {
        color: black;
    }
    
    .coin-details h2 {
        color: black;
    }
    
    .detail-group p,
    .detail-group label {
        color: black;
    }
}

/* Accessibility improvements */
.btn-filter:focus,
.btn-view-toggle:focus,
.sort-dropdown select:focus,
.btn-add-coin:focus,
.filter-options input:focus,
.btn-apply-filters:focus,
.btn-clear-filters:focus,
.page-num:focus,
.page-nav:focus,
.btn-view-coin:focus,
.btn-edit-coin:focus,
.thumbnail:focus,
.btn-zoom-in:focus,
.btn-zoom-out:focus,
.btn-rotate:focus,
.btn-edit-coin-detail:focus,
.btn-add-to-wishlist:focus,
.btn-print-details:focus,
.modal-close:focus {
    outline: 2px solid rgba(255, 204, 0, 0.5);
    outline-offset: 2px;
}