/* ================================
   Combined Styles
   - Gallery Styles (Base)
   - Upload/Form Styles
   ================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Dark Theme Colors */
    --bg-primary: #12141a;
    --bg-secondary: #1a1d24;
    --bg-card: rgba(30, 34, 44, 0.6);
    --bg-card-form: rgba(30, 34, 44, 0.8);

    /* Accent Colors - Warm Gold & Soft Rose */
    --accent-primary: #e8b866;
    --accent-secondary: #d4a056;
    --accent-glow: rgba(232, 184, 102, 0.25);

    /* Highlight - Soft Coral */
    --highlight: #e07a5f;
    --highlight-glow: rgba(224, 122, 95, 0.2);

    /* Text Colors */
    --text-primary: #f5f5f5;
    --text-secondary: rgba(245, 245, 245, 0.7);
    --text-muted: rgba(245, 245, 245, 0.5);

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(232, 184, 102, 0.4);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
}

/* Form pages body layout */
body.form-page {
    display: flex;
    flex-direction: column;
}

/* ================================
   Header
   ================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--highlight) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

/* ================================
   Buttons
   ================================ */
.upload-btn {
    padding: 0.5rem 1.2rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border: none;
    border-radius: 8px;
    color: var(--bg-primary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.back-btn {
    padding: 0.5rem 1.2rem;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(232, 184, 102, 0.1);
    border-color: var(--border-hover);
    color: var(--accent-primary);
}

/* ================================
   Container
   ================================ */
.container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Form pages container */
.container.form-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

/* ================================
   Image Cards
   ================================ */
.image-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.image-card:hover {
    transform: scale(1.03);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-hover);
    border-color: var(--border-hover);
}

.image-wrapper {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.image-card:hover .image-wrapper img {
    transform: scale(1.08);
}

/* Image Overlay */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0.95) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
}

.image-card:hover .image-overlay {
    opacity: 1;
}

.image-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    transform: translateY(15px);
    opacity: 0;
    transition: all 0.4s ease 0.1s;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.image-card:hover .image-title {
    transform: translateY(0);
    opacity: 1;
}

.image-caption {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.6rem;
    line-height: 1.4;
    transform: translateY(15px);
    opacity: 0;
    transition: all 0.4s ease 0.15s;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.image-card:hover .image-caption {
    transform: translateY(0);
    opacity: 1;
}

.image-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    transform: translateY(15px);
    opacity: 0;
    transition: all 0.4s ease 0.2s;
}

.image-card:hover .image-meta {
    transform: translateY(0);
    opacity: 1;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #fff;
    background: rgba(232, 184, 102, 0.25);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.meta-icon {
    width: 14px;
    height: 14px;
    opacity: 0.9;
}

/* ================================
   Admin Actions
   ================================ */
.admin-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.edit-btn {
    background: rgba(232, 184, 102, 0.4);
    color: #fff;
    border: 1px solid rgba(232, 184, 102, 0.6);
}

.edit-btn:hover {
    background: rgba(232, 184, 102, 0.6);
}

.delete-btn {
    background: rgba(224, 122, 95, 0.4);
    color: #fff;
    border: 1px solid rgba(224, 122, 95, 0.6);
}

.delete-btn:hover {
    background: rgba(224, 122, 95, 0.6);
}

.delete-form {
    margin: 0;
}

/* ================================
   Empty State
   ================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state h2 {
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* ================================
   Lightbox Modal
   ================================ */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 14, 18, 0.97);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-info {
    margin-top: 1.2rem;
    text-align: center;
    max-width: 550px;
}

.lightbox-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--accent-primary);
}

.lightbox-caption {
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

.lightbox-meta {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    color: var(--highlight);
    font-size: 0.85rem;
}

.lightbox-close {
    position: absolute;
    top: -35px;
    right: 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    opacity: 1;
    color: var(--accent-primary);
}

/* ================================
   Upload/Form Card
   ================================ */
.upload-card {
    width: 100%;
    max-width: 500px;
    background: var(--bg-card-form);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.card-title {
    text-align: center;
    margin-bottom: 1.5rem;
}

.card-title h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--accent-primary);
}

.card-title p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ================================
   Form Elements
   ================================ */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

input[type="text"],
input[type="password"],
input[type="datetime-local"],
textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime-local"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(232, 184, 102, 0.05);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input[type="text"]::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 70px;
}

.form-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ================================
   File Upload
   ================================ */
.file-upload {
    position: relative;
    border: 2px dashed var(--border-subtle);
    border-radius: 14px;
    padding: 1.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.file-upload:hover {
    border-color: var(--accent-primary);
    background: rgba(232, 184, 102, 0.03);
}

.file-upload.dragover {
    border-color: var(--accent-primary);
    background: rgba(232, 184, 102, 0.08);
}

.file-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 0.6rem;
    color: var(--accent-primary);
    opacity: 0.7;
}

.file-upload-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.file-upload-text strong {
    color: var(--accent-primary);
}

.file-name {
    margin-top: 0.6rem;
    padding: 0.5rem;
    background: rgba(232, 184, 102, 0.12);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--accent-primary);
    display: none;
}

/* ================================
   Submit Button
   ================================ */
.submit-btn {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border: none;
    border-radius: 10px;
    color: var(--bg-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px var(--accent-glow);
    margin-top: 0.5rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

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

/* ================================
   Responsive
   ================================ */
@media (max-width: 768px) {
    .header {
        padding: 0.8rem 1rem;
        flex-direction: column;
        gap: 0.8rem;
    }

    .container {
        padding: 1rem;
    }

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

    .upload-card {
        padding: 1.5rem;
    }

    .card-title h1 {
        font-size: 1.4rem;
    }
}

/* ================================
   Tags Navigation
   ================================ */
.tags-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
}

.tag-tab {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: capitalize;
}

.tag-tab:hover {
    background: rgba(232, 184, 102, 0.15);
    border-color: var(--border-hover);
    color: var(--accent-primary);
}

.tag-tab.active {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-color: transparent;
    color: var(--bg-primary);
}

/* ================================
   Tag Sections
   ================================ */
.tag-section {
    margin-bottom: 3rem;
}

.tag-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.tag-section-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: capitalize;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tag-section-title svg {
    width: 20px;
    height: 20px;
}

.tag-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}

.view-more-btn {
    padding: 0.4rem 1rem;
    background: transparent;
    border: 1px solid var(--accent-primary);
    border-radius: 20px;
    color: var(--accent-primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-more-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.view-less-btn {
    background: rgba(232, 184, 102, 0.2);
}

/* ================================
   Image Tags Display
   ================================ */
.image-tags {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.image-tag {
    padding: 0.15rem 0.5rem;
    background: rgba(232, 184, 102, 0.3);
    border-radius: 10px;
    font-size: 0.7rem;
    color: var(--accent-primary);
    text-transform: capitalize;
}

/* ================================
   Tag Gallery Grid
   ================================ */
.tag-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tag-gallery.collapsed .image-card:nth-child(n+4) {
    display: none;
}

/* Form hint style */
.form-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ================================
   Trending Slideshow
   ================================ */
.trending-section {
    margin-bottom: 2.5rem;
}

.trending-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.trending-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trending-title svg {
    color: var(--highlight);
    width: 24px;
    height: 24px;
}

.trending-tag-badge {
    padding: 0.3rem 0.8rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--highlight) 100%);
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bg-primary);
    text-transform: capitalize;
}

.slideshow-container {
    position: relative;
    width: 100%;
    height: 450px;
    border-radius: 20px;
    overflow: hidden;
    background: var(--bg-secondary);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.slide.active {
    opacity: 1;
}

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

.slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
}

.slide-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.slide-caption {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 600px;
}

/* Slideshow Navigation */
.slideshow-nav {
    position: absolute;
    bottom: 1.5rem;
    right: 2rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.slide-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slide-dot.active {
    background: var(--accent-primary);
    transform: scale(1.2);
}

.slideshow-arrows {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    pointer-events: none;
}

.slide-arrow {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    backdrop-filter: blur(10px);
}

.slide-arrow:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
}

.slide-arrow svg {
    width: 20px;
    height: 20px;
}

/* Responsive slideshow */
@media (max-width: 768px) {
    .slideshow-container {
        height: 300px;
    }

    .slide-title {
        font-size: 1.3rem;
    }

    .slide-overlay {
        padding: 1.5rem;
    }
}