:root {
    --primary: #002787;
    --primary-dark: #218a4c;
    --secondary: #6a00ff;
    --text: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --white: #fff;
    --highlight: #ffdb58;
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --grid-gap: 20px;
    --card-padding: 15px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    font-family: 'Nunito', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg-light);
    scroll-behavior: smooth;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--secondary);
    color: white;
    text-align: center;
    padding: 50px 20px;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/pattern.png');
    opacity: 0.1;
    z-index: 0;
}

.logo {
    margin-bottom: 20px;
}

.logo img {
    height: 80px;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

header h1 {
    font-family: 'Chewy', cursive;
    font-size: 3rem;
    margin: 0 0 10px;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* Controls */
.controls {
    background: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 10;
}

.controls .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#search-input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: inherit;
    min-width: 200px;
}

#sort-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: inherit;
    background-color: white;
}

#filter-btn {
    padding: 10px 20px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

#filter-btn:hover {
    background-color: var(--primary-dark);
}

.view-options {
    display: flex;
    gap: 10px;
}

.view-options button {
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.view-options button.active {
    background-color: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

.home-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--secondary);
    color: white;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.home-btn:hover {
    background-color: #5500cc;
    transform: translateY(-2px);
}

.home-btn i {
    font-size: 1.1rem;
}

/* Gallery */
.collection-gallery {
    padding: 40px 0;
}

.loading {
    text-align: center;
    padding: 50px 0;
}

.spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Grid View */
.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--grid-gap);
}

.gallery-item {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.item-details {
    padding: var(--card-padding);
}

.item-details h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--secondary);
}

/* List View */
.list-view {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.list-view .gallery-item {
    display: flex;
    align-items: center;
}

.list-view .gallery-item img {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.list-view .item-details {
    flex-grow: 1;
    padding: 20px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    gap: 10px;
}

.pagination button {
    padding: 10px 20px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
    background-color: var(--primary-dark);
}

.pagination button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#page-indicators {
    display: flex;
    gap: 5px;
}

.page-indicator {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.page-indicator.active {
    background-color: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 800px;
    width: 90%;
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.close-lightbox {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    color: white;
    cursor: pointer;
    z-index: 1010;
}

.lightbox-navigation {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    transform: translateY(-50%);
    z-index: 1005;
}

.lightbox-navigation button {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-navigation button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

#lightbox-img {
    width: 100%;
    display: block;
}

.lightbox-details {
    padding: 20px;
    background-color: white;
}

.lightbox-details h2 {
    color: var(--secondary);
    margin-bottom: 10px;
}

/* Footer */
footer {
    background-color: var(--primary);
    color: white;
    padding: 30px 0;
    text-align: center;
}

footer .container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-links, .social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

footer a {
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

footer a:hover {
    text-decoration: underline;
    opacity: 0.9;
}

.social-links a {
    font-size: 1.5rem;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
}

.back-to-top:hover {
    background: var(--secondary);
}

/* Responsive */
@media (max-width: 992px) {
    .grid-view {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .grid-view .gallery-item img {
        height: 180px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .controls .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-filter {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    #search-input {
        flex-grow: 1;
    }
    
    .home-btn {
        margin-bottom: 10px;
    }
    
    .list-view .gallery-item {
        flex-direction: column;
    }
    
    .list-view .gallery-item img {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 576px) {
    .grid-view {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .grid-view .gallery-item img {
        height: 140px;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
} 