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

:root {
    --primary-color: #E2007A;
    --secondary-color: #00B7B7;
    --success-color: #39B54A;
    --bg-color: #0f0f11;
    --card-bg: rgba(30, 30, 35, 0.6);
    --text-primary: #f0f0f0;
    --text-secondary: #aaaaaa;
    --border-radius: 12px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at top right, rgba(226, 0, 122, 0.1), transparent 400px),
                      radial-gradient(circle at bottom left, rgba(0, 183, 183, 0.1), transparent 400px);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

header {
    background: rgba(15, 15, 17, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

header nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 20px;
    transition: color 0.3s;
}

header nav a:hover {
    color: var(--primary-color);
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    flex: 1;
    width: 100%;
}

.page-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
    color: var(--text-primary);
}

/* Home Gallery Grid Additions */
.galleries-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

@media (max-width: 900px) {
    .galleries-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .galleries-grid { grid-template-columns: repeat(1, 1fr); }
}

.gallery-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(226, 0, 122, 0.15);
}

.gallery-cover {
    width: 100%;
    height: 280px;
    background-color: #ddd;
    background-size: cover;
    background-position: center;
    position: relative;
}

.gallery-cover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-card:hover .gallery-cover-overlay {
    opacity: 1;
}

.gallery-cover-overlay span {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.gallery-card-content {
    padding: 20px;
    text-align: center;
    border-top: 2px solid var(--primary-color);
}

.gallery-icon-small {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.gallery-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.gallery-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Login */
.login-container {
    max-width: 400px;
    margin: 60px auto;
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.login-container h2 { color: var(--primary-color); margin-bottom: 20px; }
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; }
.form-control { width: 100%; padding: 12px 15px; background: rgba(0,0,0,0.3); color: var(--text-primary); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; font-size: 1rem; outline: none; transition: all 0.3s; }
.form-control:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(226, 0, 122, 0.2); }
.btn { display: inline-block; padding: 12px 25px; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s; text-decoration: none; text-align: center; }
.btn-primary { background-color: var(--primary-color); color: white; width: 100%; }
.btn-primary:hover { background-color: #B30060; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(226, 0, 122, 0.3); }
.btn-secondary { background-color: var(--secondary-color); color: white; }
.btn-secondary:hover { background-color: #009c9c; }
.error-msg { color: red; font-size: 0.9rem; margin-bottom: 15px; }

/* Photogrid layout overrides */
.gallery-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid #ddd; }
.gallery-header h2 { font-size: 2rem; }

.photos-grid {
    column-count: 4;
    column-gap: 20px;
}

/* Responsive constraints for Photos Grid */
@media (max-width: 900px) {
    .photos-grid { column-count: 3; }
}
@media (max-width: 600px) {
    .photos-grid { column-count: 2; }
}

.photo-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    break-inside: avoid;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.05);
}

.photo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.4);
    border-color: rgba(226, 0, 122, 0.3);
}

.photo-img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: filter 0.3s;
}

.photo-img:hover {
    filter: brightness(1.1);
}

.photo-btn-container {
    padding: 10px;
    display: flex;
    justify-content: center;
}

.btn-download-sm {
    background: var(--primary-color);
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    justify-content: center;
    transition: background 0.2s;
}

.btn-download-sm:hover {
    background: #B30060;
    color: white;
}

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

.page-btn {
    padding: 10px 15px;
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
}

.page-btn:hover { background: rgba(255,255,255,0.1); }
.page-btn.active { background: var(--primary-color); border-color: var(--primary-color); color: white; }
.page-btn.disabled { opacity: 0.5; pointer-events: none; }

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.lightbox-close {
    position: absolute;
    top: 20px; right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

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

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

.lightbox-footer {
    margin-top: 20px;
}

.lightbox-download {
    background: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s, transform 0.2s;
}

.lightbox-download:hover {
    background: #B30060;
    transform: scale(1.05);
}

/* Base class for gallery actions replacing inline styles */
.gallery-actions {
    display: flex; 
    gap: 15px; 
    align-items: center; 
    flex-wrap: wrap; 
    justify-content: flex-end;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 15px 20px;
        gap: 15px;
        text-align: center;
    }
    
    header nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }
    
    header nav a {
        margin-left: 0;
        font-size: 0.95rem;
        background: var(--bg-color);
        padding: 8px 12px;
        border-radius: 6px;
    }
    
    .gallery-header {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        text-align: center;
    }

    .gallery-actions {
        justify-content: center;
        flex-direction: column;
        width: 100%;
    }
    
    .gallery-actions form {
        width: 100%;
    }

    .gallery-actions select, .gallery-actions .btn-secondary {
        width: 100%;
        text-align: center;
        display: block;
    }
    
    /* Admin Mobile Adjustments */
    .toolbar {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    
    .form-inline {
        flex-direction: column;
        width: 100%;
    }
    
    .form-inline .form-control {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .dashboard-table th, .dashboard-table td {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .pagination {
        gap: 8px;
    }
    
    .page-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* Footer Styles */
footer {
    background-color: #1a1a1a;
    color: #eee;
    padding: 60px 20px 20px 20px;
    margin-top: auto; 
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns now */
    gap: 30px;
}

.footer-col h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-col p, .footer-col a {
    color: #ccc;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: white;
}

.footer-col i {
    width: 20px;
    text-align: center;
    margin-right: 5px;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 20px;
    margin-top: 40px;
    font-size: 0.85rem;
    color: #888;
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
