/* .container{
    margin-bottom: 20px;
} */

/* ===== Gallery Section ===== */
.gallery-section {
    padding: 6rem 2rem;       /* top & bottom padding */
    background: #f8f9fa;
}

/* Grid Layout */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 320px));
    gap: 1.5rem;
    justify-content: center;   /* 🔑 THIS IS THE KEY */
}


/* Gallery item container */
.gallery-item {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    height: 260px;              /* fixed height for consistency */
    background: #000;           /* prevents white gaps */
}

/* Image behavior */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;          /* crops safely */
    object-position: center;    /* centers all images */
    transition: transform 0.6s ease;
    display: block;
}

/* Hover zoom (safe zoom) */
.gallery-item:hover img {
    transform: scale(1.08);
}

/* Overlay alignment */
.gallery-item .overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 1.8rem;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85),
        rgba(0, 0, 0, 0.15),
        transparent
    );
}

/* Overlay text */
.gallery-item .overlay span {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
    max-width: 90%;
}

#imageCategory {
    width: 100%;
    padding: 14px 16px;
    font-size: 0.85rem;
    font-family: inherit;
    border-radius: 12px;
    color: #897c7c;
    cursor: pointer;
    appearance: none;          /* Remove default arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg fill='none' stroke='%23666' stroke-width='2' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}


/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .gallery-item { height: 220px; }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr 1fr; /* 2 columns for tablets */
    }
    .gallery-item { height: 200px; }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr; /* 1 column for mobile */
    }
    .gallery-item { height: 180px; }
}

/* ================================
   ADMIN CONTROLS (Gallery Page)
================================ */

/* Admin button bar */
.admin-bar {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Admin buttons */
.admin-btn,
.add-btn {
    padding: 0.7rem 1.4rem;
    border-radius: 30px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Are you Admin button */
.admin-btn {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.admin-btn:hover {
    background: var(--accent);
    color: var(--primary-dark);
}

/* Add Image button */
.add-btn {
    background: var(--accent);
    color: var(--primary-dark);
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Utility */
.hidden {
    display: none !important;
}

/* ================================
   MODAL STYLES
================================ */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Modal box */
.modal-box {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 25px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    text-align: center;
}

/* Modal headings */
.modal-box h3 {
    margin-bottom: 1.5rem;
    color: var(--accent);
}

/* Modal inputs */
.modal-box input,
.modal-box select {
    width: 100%;
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-main);
    outline: none;
}

/* Modal button */
.modal-box button {
    width: 100%;
    padding: 0.7rem;
    border-radius: 30px;
    border: none;
    background: var(--accent);
    color: var(--primary-dark);
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.modal-box button:hover {
    opacity: 0.9;
}

/* ================================
   RESPONSIVE
================================ */

@media (max-width: 768px) {
    .admin-bar {
        justify-content: center;
    }
}

/* ================================
   GALLERY FILTER (TOPIC CARDS)
================================ */

.filter-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 3.5rem;
}

/* Individual Topic Card */
.topic-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    padding: 1.4rem 2rem;
    border-radius: 22px;
    min-width: 150px;

    text-align: center;
    cursor: pointer;
    transition: var(--transition);

    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Icon */
.topic-card i {
    display: block;
    font-size: 1.8rem;
    margin-bottom: 0.7rem;
    color: var(--accent);
    transition: var(--transition);
}

/* Label */
.topic-card span {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-main);
}

/* Hover Effect */
.topic-card:hover {
    transform: translateY(-6px);
    background: var(--glass-hover);
    border-color: var(--accent);
}

/* Active State */
.topic-card.active {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-6px);
}

/* Active text & icon */
.topic-card.active span,
.topic-card.active i,
.topic-card:hover span,
.topic-card:hover i {
    color: var(--primary-dark);
}

/* ================================
   RESPONSIVE
================================ */

@media (max-width: 768px) {
    .topic-card {
        min-width: 130px;
        padding: 1.2rem 1.6rem;
    }

    .topic-card i {
        font-size: 1.5rem;
    }
}

/* Close (X) button */
.close-modal {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--text-muted);
}

.close-modal:hover {
    color: var(--accent);
}

/* Delete button on image */
.delete-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,0,0,0.9);
    color: #fff;
    border: none;
    padding: 6px 9px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: none;
    z-index: 10;
}

.gallery-item:hover .delete-btn {
    display: block;
}
.delete-btn:hover {
    background: rgba(255,0,0,1);
}

.hidden {
    display: none !important;
}

