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

:root {
    --selfix-red: #e30b0b;
    --bg-dark: #000000;
    --text-dark: #ffffff;
    --bg-light: #f5f5f5;
    --text-light: #2c2c2c;
}

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

body {
    font-family: 'Outfit', sans-serif;
}

/* ==================
   CLIENT PAGE (index.html)
   ================== */
body.client-body {
    background-color: var(--bg-light);
    color: var(--text-light);
}

.client-header {
    background: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo span {
    color: var(--selfix-red);
}

.btn-register {
    background: var(--selfix-red);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

.client-content {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    min-height: calc(100vh - 70px);
}

.event-banner {
    background-color: #e6f2ff;
    background-image: radial-gradient(#a3cfff 2px, transparent 2px);
    background-size: 20px 20px;
    padding: 3rem 1rem;
    text-align: center;
    border-bottom: 2px solid #eee;
}

.event-banner h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #333;
    display: inline-block;
    background: white;
    padding: 0.5rem 2rem;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.tabs {
    display: flex;
}

.tab {
    flex: 1;
    padding: 1rem;
    border: none;
    background: #f0f0f0;
    font-weight: 600;
    font-size: 1rem;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
}

.tab.active {
    background: white;
    color: var(--selfix-red);
    border-bottom: 3px solid var(--selfix-red);
}

.form-container {
    padding: 2rem 1.5rem;
}

.input-field {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 1rem;
    outline: none;
}

.input-field:focus {
    border-color: var(--selfix-red);
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
}

.btn-upload {
    background: #f8f8f8;
    border: 2px dashed #ccc;
    color: #555;
    padding: 3rem 1rem;
    border-radius: 15px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
}

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

.btn-submit {
    width: 100%;
    background: var(--selfix-red);
    color: white;
    border: none;
    padding: 1.2rem;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 1rem;
    transition: transform 0.2s;
}

.btn-submit:active {
    transform: scale(0.98);
}

#preview-img {
    width: 100%;
    border-radius: 10px;
    display: none;
    margin-bottom: 1rem;
}

/* ==================
   SCREEN PAGE (screen.html)
   ================== */
body.screen-body {
    background-color: var(--bg-dark);
    color: var(--text-dark);
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

.screen-layout {
    display: flex;
    height: 100%;
}

.screen-sidebar {
    width: 380px;
    background: #000000;
    border-right: 1px solid #222;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 2rem;
    flex-shrink: 0;
}

.screen-sidebar .logo {
    font-size: 3.5rem;
    margin-bottom: 4rem;
}

.qr-container {
    background: white;
    padding: 1rem;
    border-radius: 20px;
    margin-bottom: 2rem;
}

.qr-container img {
    width: 250px;
    height: 250px;
    display: block;
}

.qr-instruction {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.4;
    text-transform: uppercase;
    color: #ffffff;
}

.screen-main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: #000000;
}

.screen-main::-webkit-scrollbar {
    width: 0; /* hide scrollbar for clean look */
}

.masonry {
    column-count: 4;
    column-gap: 1.5rem;
}

@media (max-width: 1600px) { .masonry { column-count: 3; } }
@media (max-width: 1000px) { .masonry { column-count: 2; } }

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    background: #111;
    border-radius: 15px;
    overflow: hidden;
    padding-bottom: 1rem;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.masonry-item img {
    width: 100%;
    display: block;
}

.masonry-item .content-wrapper {
    padding: 1rem;
}

.masonry-item .author {
    font-weight: 800;
    color: var(--selfix-red);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.masonry-item .message {
    font-size: 1.1rem;
    line-height: 1.3;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* ==================
   ADMIN PAGE
   ================== */
body.admin-body {
    background-color: #f0f2f5;
    color: #333;
}

.admin-header {
    background: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.admin-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.admin-card img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

.admin-card-content {
    padding: 1rem;
    flex: 1;
}

.admin-card .author {
    font-weight: bold;
    font-size: 1.1rem;
}

.admin-card .message {
    color: #555;
    margin-top: 0.5rem;
}

.admin-actions {
    display: flex;
    border-top: 1px solid #eee;
}

.btn-approve, .btn-reject {
    flex: 1;
    padding: 1rem;
    border: none;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
}

.btn-approve {
    background: #4caf50;
    color: white;
}

.btn-reject {
    background: #f44336;
    color: white;
}

/* ==================
   ALBUM & SLIDESHOW
   ================== */
.btn-download-album {
    background: var(--selfix-red);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 800;
    display: inline-block;
}
.btn-download-album:hover {
    background: #c00808;
}

.album-item {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.screen-controls {
    margin-top: auto;
    width: 100%;
    margin-bottom: -1rem;
    display: flex;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-control {
    flex: 1;
    background: none;
    border: 2px solid white;
    color: white;
    padding: 0.8rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
}

.btn-control:hover, .btn-control.active {
    background: white;
    color: black;
}

.slideshow-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

.slideshow-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.slideshow-overlay img {
    max-width: 95%; /* Constrained to parent container width */
    max-height: 95%; /* Constrained to parent container height */
    object-fit: contain; /* Ensures the whole image is visible regardless of ratio */
    border-radius: 20px;
    animation: fadeScale 0.8s ease-out;
}

@keyframes fadeScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ==================
   PLANTILLAS (TEMPLATES)
   ================== */

/* Template: Neon */
body.theme-neon.client-body { background-color: #0d0e15; color: #fff; }
body.theme-neon .client-header { background: #111; color: #fff; }
body.theme-neon .event-banner { background-color: #240046; background-image: radial-gradient(#9d4edd 2px, transparent 2px); }
body.theme-neon .event-banner h2 { background: #3c096c; color: #fff; box-shadow: 0 0 15px #c77dff; }
body.theme-neon .tab.active { background: #111; border-bottom-color: #c77dff; color: #c77dff; }
body.theme-neon .btn-submit { background: #7b2cbf; box-shadow: 0 0 10px #9d4edd; }
body.theme-neon.screen-body { background-color: #0d0e15; }
body.theme-neon .screen-sidebar { background: #08080a; border-right: 1px solid #7b2cbf; box-shadow: 0 0 20px rgba(123, 44, 191, 0.3); }
body.theme-neon .screen-main { background-image: radial-gradient(circle at top right, rgba(123, 44, 191, 0.2), transparent), radial-gradient(circle at bottom left, rgba(157, 78, 221, 0.2), transparent); }
body.theme-neon .qr-container { background: #fff; box-shadow: 0 0 20px #e0aaff; border: 4px solid #7b2cbf; }

/* Template: Elegante */
body.theme-elegante.client-body { background-color: #fcfbf9; }
body.theme-elegante .client-header { background: #fff; border-bottom: 1px solid #eadbc8; }
body.theme-elegante .event-banner { background-color: #f7f1e5; background-image: none; border-bottom: 1px solid #eadbc8; }
body.theme-elegante .event-banner h2 { background: none; box-shadow: none; font-family: serif; font-style: italic; color: #8e7d5f; font-weight: 400; font-size: 3rem; }
body.theme-elegante .btn-submit { background: #8e7d5f; border-radius: 5px; }
body.theme-elegante.screen-body { background-color: #fcfbf9; color: #333; }
body.theme-elegante .screen-sidebar { background: #f7f1e5; border-right: 2px solid #eadbc8; }
body.theme-elegante .screen-main { background-color: #fcfbf9; }
body.theme-elegante .qr-instruction { color: #8e7d5f; font-family: serif; font-weight: normal; font-style: italic; }
body.theme-elegante .masonry-item { background: #fff; border: 1px solid #eadbc8; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
body.theme-elegante .masonry-item .author { color: #8e7d5f; font-family: serif; font-style: italic; font-weight: normal; font-size: 1.4rem; }
