/* Base Styling - Heritage Theme */
:root {
    --bg-color: #f7f5f0; /* Warm cream */
    --text-color: #2b302c; /* Deep forest slate */
    --primary-color: #2e4a3d; /* Deep forest green */
    --primary-dark: #1b3026;
    --accent-color: #c79e65; /* Warm gold/sepia accent */
    --card-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(200, 180, 150, 0.4);
    --shadow: 0 10px 40px rgba(46, 74, 61, 0.08);
}

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

body {
    font-family: 'Lora', serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(at 0% 0%, rgba(199, 158, 101, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(46, 74, 61, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
}

h1, h2, h3 {
    font-family: 'Cinzel', serif;
    font-weight: 600;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

/* --- Login Page --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    padding: 3.5rem 4rem;
    border-radius: 8px; /* Sharper corners for a classic look */
    text-align: center;
    max-width: 450px;
    width: 100%;
    animation: fadeIn 0.8s ease-out;
}

.login-card h1 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.login-card .subtitle {
    font-size: 1rem;
    color: #555;
    margin-bottom: 2.5rem;
    font-style: italic;
}

.error-message {
    color: #8c2a2a;
    background: rgba(140, 42, 42, 0.1);
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d4c8b8;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(199, 158, 101, 0.2);
}

.btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 74, 61, 0.3);
}

/* --- Gallery Page --- */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    background: rgba(247, 245, 240, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.header-content p {
    font-size: 0.95rem;
    color: #666;
    font-style: italic;
}

.logout-btn {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    font-family: 'Cinzel', serif;
    padding: 8px 16px;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: var(--accent-color);
    color: #fff;
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 5%;
}

.folder-section {
    margin-bottom: 4rem;
    animation: fadeIn 0.8s ease-out;
}

.folder-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    color: var(--primary-color);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.photo-card {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3; /* Classic photo aspect ratio */
    background: #e8e4db;
    box-shadow: var(--shadow);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
    border: 6px solid #fff; /* Polaroid/Classic border effect */
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    filter: sepia(0.2); /* Slight vintage tint */
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(46, 74, 61, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.photo-overlay span {
    color: white;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1.2rem;
    padding: 10px 20px;
    border: 1px solid white;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.photo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.photo-card:hover img {
    transform: scale(1.05);
    filter: sepia(0); /* Remove tint on hover */
}

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

.photo-card:hover .photo-overlay span {
    transform: translateY(0);
}

.empty-state {
    text-align: center;
    padding: 5rem 0;
    color: #666;
    font-size: 1.2rem;
    font-style: italic;
}

/* --- Lightbox --- */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(27, 48, 38, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.lightbox-content-wrapper {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-content {
    max-width: 100%;
    max-height: 90vh;
    border: 10px solid #fff;
    border-radius: 2px;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1001;
}

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

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .login-card {
        padding: 2rem;
    }
    .gallery-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .folder-title {
        font-size: 1.5rem;
    }
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
}
