/* Gallery Page Specific Styles */

/* Gallery Hero Section */
.gallery-hero {
    background: linear-gradient(135deg, var(--white) 0%, var(--yellow-light) 100%);
    padding: 120px 0 80px;
    text-align: center;
}

.gallery-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--black);
    margin-bottom: 1rem;
}

.gallery-subtitle {
    font-size: 1.2rem;
    color: var(--gray-dark);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Gallery Main Section */
.gallery-main {
    padding: 4rem 0;
    background: var(--white);
    min-height: 60vh;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
}

.loader {
    width: 50px;
    height: 50px;
    margin: 0 auto 1.5rem;
    border: 4px solid var(--yellow-light);
    border-top-color: var(--yellow-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-state p {
    color: var(--gray-dark);
    font-size: 1.1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 6rem 2rem;
}

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

.empty-state h2 {
    font-size: 2rem;
    color: var(--black);
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--gray-dark);
    font-size: 1.1rem;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 5px 20px var(--shadow);
    transition: all 0.3s ease;
    background: var(--gray-light);
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px var(--shadow-lg);
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.5) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
    transform: translateY(10px);
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item-title {
    color: var(--white);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.gallery-item-date {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

.lightbox.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: var(--white);
    font-size: 2.5rem;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    color: var(--yellow-primary);
    transform: rotate(90deg);
    transition: all 0.3s ease;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.lightbox-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid var(--white);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.lightbox-btn:hover {
    background: var(--yellow-primary);
    border-color: var(--yellow-primary);
    color: var(--black);
    transform: scale(1.1);
}

.lightbox-btn:active {
    transform: scale(0.95);
}

#prevBtn {
    left: 20px;
}

#nextBtn {
    right: 20px;
}

/* Active Nav Link */
.nav-menu a.active {
    color: var(--yellow-dark);
    position: relative;
}

.nav-menu a.active::after {
    width: 100%;
}

/* Responsive Design */
@media (max-width: 968px) {
    .gallery-title {
        font-size: 2.5rem;
    }

    .gallery-subtitle {
        font-size: 1.1rem;
    }

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

@media (max-width: 568px) {
    .gallery-hero {
        padding: 100px 0 60px;
    }

    .gallery-title {
        font-size: 2rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .lightbox-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .lightbox-close {
        top: -50px;
        right: 10px;
    }
}

/* Image Loading Animation */
@keyframes imageLoad {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-item {
    animation: imageLoad 0.5s ease;
}

/* Admin Panel Styles */
.admin-panel {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.admin-panel.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-panel-content {
    background: var(--white);
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    margin: 2rem auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-header {
    background: linear-gradient(135deg, var(--yellow-primary), var(--yellow-dark));
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--black);
}

.admin-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.admin-close {
    background: none;
    border: none;
    font-size: 2.5rem;
    color: var(--black);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
}

.admin-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.admin-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.admin-section {
    margin-bottom: 2.5rem;
}

.admin-section:last-child {
    margin-bottom: 0;
}

.admin-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--black);
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--yellow-light);
    border-radius: 15px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--gray-light);
}

.upload-area:hover {
    border-color: var(--yellow-primary);
    background: var(--yellow-light);
    transform: translateY(-2px);
}

.upload-area.drag-over {
    border-color: var(--yellow-dark);
    background: var(--yellow-light);
    transform: scale(1.02);
}

.upload-placeholder svg {
    color: var(--yellow-dark);
    margin-bottom: 1rem;
}

.upload-placeholder p {
    color: var(--gray-dark);
    margin: 0.5rem 0;
    font-size: 1rem;
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--gray-dark);
}

/* Selected Files Preview */
.selected-files {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

.file-item-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-preview {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1;
    border: 2px solid var(--yellow-light);
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview .file-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.file-preview .file-remove:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.file-name-input {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid var(--gray-medium);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background: var(--white);
}

.file-name-input:focus {
    outline: none;
    border-color: var(--yellow-primary);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

/* Upload Progress */
.upload-progress {
    margin-top: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--yellow-primary), var(--yellow-dark));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

#progressText {
    font-size: 0.9rem;
    color: var(--gray-dark);
    text-align: center;
    margin: 0;
}

/* Admin Image List */
.admin-image-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.admin-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--gray-medium);
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-image-item:hover {
    border-color: var(--yellow-primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow);
}

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

.admin-image-item .delete-btn {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 0, 0, 0.9);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    opacity: 0;
}

.admin-image-item:hover .delete-btn {
    opacity: 1;
}

.admin-image-item .delete-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: translateX(-50%) scale(1.05);
}

.image-controls {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.admin-image-item:hover .image-controls {
    opacity: 1;
}

.image-name-input {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid var(--white);
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.95);
    color: var(--black);
    transition: all 0.3s ease;
}

.image-name-input:focus {
    outline: none;
    border-color: var(--yellow-primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3);
}

.admin-image-item .image-name-display {
    position: absolute;
    bottom: -30px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    transition: bottom 0.3s ease;
    pointer-events: none;
}

.admin-image-item:hover .image-name-display {
    bottom: 50px;
}

/* Responsive Admin Panel */
@media (max-width: 568px) {
    .admin-panel-content {
        width: 95%;
        max-height: 95vh;
        margin: 1rem auto;
        border-radius: 15px;
    }

    .admin-header {
        padding: 1rem 1.5rem;
    }

    .admin-header h2 {
        font-size: 1.5rem;
    }

    .admin-body {
        padding: 1.5rem;
    }

    .admin-image-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }
}

