:root {
    --bg-color: #f4f4f9;
    --text-color: #333;
    --primary: #007bff;
    --primary-hover: #0056b3;
    --danger: #dc3545;
    --card-bg: #fff;
    --nav-height: 60px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container, .admin-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* ================= Navbar (Sticky) ================= */
.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    z-index: 100;
}

.nav-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    margin: 0;
}

/* ================= Nav Buttons ================= */
.nav-buttons {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ================= Botón Instagram ================= */
.ig-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 20px;
    /* Degradado oficial de Instagram */
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    transition: transform 0.2s, opacity 0.2s;
    font-size: 0.9rem;
}

.ig-btn:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.ig-icon {
    width: 20px;
    height: 20px;
}

/* ================= Botón GitHub ================= */
.github-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 20px;
    background-color: #333;
    transition: transform 0.2s, opacity 0.2s;
    font-size: 0.9rem;
}

.github-btn:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.github-icon {
    width: 20px;
    height: 20px;
}

/* Ocultar el texto en móviles muy pequeños para ahorrar espacio */
@media (max-width: 400px) {
    .ig-text {
        display: none;
    }
    .github-text {
        display: none;
    }
}

/* ================= Index - Hero State ================= */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 10vh;
}

.main-gif {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

.placeholder-text {
    font-size: 1.2rem;
    color: #666;
}

/* ================= Index - Gallery State ================= */
.gallery-container {
    padding-top: 20px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.gallery img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery img:hover {
    transform: scale(1.02);
}

/* ================= Lightbox ================= */
.lightbox {
    display: none; /* Oculto por defecto */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

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

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

.close-lightbox:hover {
    color: #ccc;
}

/* ================= Admin / Login Styles ================= */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-box {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 320px;
    text-align: center;
}

.login-box input {
    width: 100%;
    padding: 10px;
    margin: 15px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-controls {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.admin-controls form {
    margin-bottom: 15px;
}

.photo-card {
    position: relative;
    display: flex;
    flex-direction: column;
}

.photo-card form {
    margin-top: 5px;
}

/* ================= Botones ================= */
.btn {
    display: inline-block;
    padding: 10px 15px;
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
    text-align: center;
}

.btn:hover { background-color: var(--primary-hover); }
.btn-danger { background-color: var(--danger); }
.btn-danger:hover { background-color: #bd2130; }
.btn-sm { padding: 5px 10px; font-size: 0.9rem; width: 100%; }
.btn-toggle { background-color: #28a745; }
.btn-toggle:hover { background-color: #218838; }

.error { color: var(--danger); }