/* =========================================
   VARIÁVEIS E BASE
========================================= */
:root { --primary: #7ED3C2; --logo-blue: #5AC8FA; --secondary: #B8CCE4; --bg-center: #ffffff; --bg-edge: #d5e5f5; --text: #4A4A4A; }
body { font-family: 'Segoe UI', Roboto, sans-serif; background: radial-gradient(circle at center, var(--bg-center) 0%, #eaf2f8 50%, var(--bg-edge) 100%); background-attachment: fixed; color: var(--text); margin: 0; padding: 0; padding-bottom: 40px; display: flex; flex-direction: column; min-height: 100vh; box-sizing: border-box; }
.hidden { display: none !important; }

/* =========================================
   TELAS E CONTAINERS PRINCIPAIS
========================================= */
.container { max-width: 400px; margin: 0 auto; text-align: center; padding: 5px 15px 15px 15px; width: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; position: relative; z-index: 10; transition: opacity 0.5s ease, visibility 0.5s ease; }
.card.glass { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(15px); border-radius: 15px; padding: 15px 20px; box-shadow: 0 8px 32px rgba(0,0,0,0.1); width: 100%; box-sizing: border-box; position: relative; }
.admin-layout { max-width: 1000px; margin: 0 auto; padding: 10px 15px; width: 100%; box-sizing: border-box; position: relative; z-index: 10; }
.header-admin { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.8); padding: 12px 15px; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); margin-bottom: 15px; gap: 10px; }

/* =========================================
   MELHORIAS VISUAIS E AVISOS
========================================= */
.card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.status-badge { padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: bold; color: white; text-transform: uppercase; letter-spacing: 0.5px; }
.status-ativo { background: var(--primary); animation: pulseSoft 2s infinite; }
.status-encerrado { background: #d9534f; opacity: 0.85; }
@keyframes pulseSoft { 0% { box-shadow: 0 0 0 0 rgba(126, 211, 194, 0.5); } 70% { box-shadow: 0 0 0 8px rgba(126, 211, 194, 0); } 100% { box-shadow: 0 0 0 0 rgba(126, 211, 194, 0); } }

.section-group { margin-top: 15px; text-align: left; width: 100%; }
.section-title { font-size: 0.75rem; font-weight: 800; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; border-bottom: 1px solid #e0e0e0; padding-bottom: 5px; }

.success-animation { text-align: center; padding: 20px; background: #eafffa; border: 2px solid var(--primary); border-radius: 12px; }
.success-icon { font-size: 4rem; display: block; margin-bottom: 10px; animation: bounceIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
@keyframes bounceIn { 0% { opacity: 0; transform: scale(0.3); } 50% { opacity: 1; transform: scale(1.1); } 70% { transform: scale(0.9); } 100% { opacity: 1; transform: scale(1); } }

.custom-toast { position: fixed; top: -100px; left: 50%; transform: translateX(-50%); background: white; color: var(--text); padding: 15px 25px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); z-index: 999999; font-weight: bold; font-size: 0.9rem; display: flex; align-items: center; gap: 10px; width: max-content; max-width: 90vw; transition: top 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); border-left: 5px solid var(--primary); }
.custom-toast.show { top: 30px; }
.custom-toast.error { border-left-color: #d9534f; }

.confirm-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.6); z-index: 999999; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: 0.3s; }
.confirm-overlay.show { opacity: 1; visibility: visible; }
.confirm-box { background: white; padding: 25px; border-radius: 15px; width: 90%; max-width: 350px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.3); transform: scale(0.8); transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.confirm-overlay.show .confirm-box { transform: scale(1); }
.confirm-buttons { display: flex; gap: 10px; margin-top: 20px; justify-content: center;}

/* =========================================
   MODAL E LOGOTIPOS
========================================= */
.modal { position: fixed !important; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); display: flex; justify-content: center; align-items: center; z-index: 100000; }
.modal-content { background: white; padding: 20px; border-radius: 15px; width: 90%; max-width: 400px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); text-align: left; }
.modal-label { font-size: 0.85rem; font-weight: bold; color: #666; margin-bottom: 5px; display: block; }
.modal-content input, .modal-content textarea { width: 100%; padding: 10px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; font-family: inherit; font-size: 0.95rem; }
.actions { display: flex; justify-content: space-between; gap: 10px; }

.terms-modal-content { background: white; padding: 25px; border-radius: 15px; width: 90%; max-width: 500px; box-shadow: 0 10px 40px rgba(0,0,0,0.4); text-align: left; max-height: 80vh; overflow-y: auto; font-size: 0.85rem; color: #444; line-height: 1.5; }
.terms-modal-content h3 { color: var(--primary); margin-top: 0; margin-bottom: 15px; font-size: 1.3rem; }
.terms-modal-content h4 { color: #333; margin-top: 15px; margin-bottom: 5px; font-size: 0.95rem; }

.app-logo { display: block; margin: 0 auto; object-fit: contain; position: relative; z-index: 10; }
.logo-main { width: 140px; max-width: 60%; margin-top: 5px; margin-bottom: 10px !important; }
.loading-logo { width: 200px; max-width: 80%; margin-bottom: 20px; animation: pulse 2s infinite ease-in-out; }
.logo-header { width: 140px; margin: 0 !important; }

/* =========================================
   LOADING E FOTOS DE CAPA
========================================= */
.loading-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at center, var(--bg-center) 0%, #eaf2f8 50%, var(--bg-edge) 100%); display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 9999; transition: 0.5s ease; }
.loading-screen.fade-out { opacity: 0; visibility: hidden; }
.progress-container { width: 80%; max-width: 250px; height: 6px; background-color: rgba(255,255,255,0.5); border-radius: 10px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 10px; animation: loadProgress 2.5s ease-out forwards; }
@keyframes loadProgress { 0% { width: 0%; } 100% { width: 100%; } }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }

.event-cover-container { width: 100%; height: 110px; border-radius: 12px; overflow: hidden; margin-bottom: 8px; background: #eee; position: relative; }
.event-cover-img { width: 100%; height: 100%; object-fit: cover; }
.message-overlay { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.6); color: white; padding: 12px 25px; border-radius: 50px; font-size: 1.2rem; max-width: 80%; text-align: center; backdrop-filter: blur(5px); border: 1px solid rgba(255,255,255,0.2); z-index: 100; animation: fadeInUp 0.8s ease-out; }
@keyframes fadeInUp { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* =========================================
   ÁLBUM, LOBBY E APRESENTAÇÃO
========================================= */
#bg-slideshow { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 0; overflow: hidden; pointer-events: none; }
.slide-img { position: absolute; border-radius: 12px; box-shadow: 0 8px 20px rgba(0,0,0,0.2); opacity: 0; object-fit: cover; border: 4px solid white; animation-name: fadeFloat; animation-timing-function: ease-in-out; animation-fill-mode: forwards; }
@keyframes fadeFloat { 0% { opacity: 0; transform: scale(0.6) translateY(30px) rotate(-5deg); } 15% { opacity: 0.4; transform: scale(1) translateY(0) rotate(2deg); } 85% { opacity: 0.4; transform: scale(1) translateY(-20px) rotate(5deg); } 100% { opacity: 0; transform: scale(0.6) translateY(-50px) rotate(10deg); } }

#albumView { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: var(--bg-center); z-index: 18000; display: flex; flex-direction: column; padding: 20px; box-sizing: border-box; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; overflow-y: auto; padding-bottom: 30px; }
.album-item { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #eee; box-shadow: 0 2px 5px rgba(0,0,0,0.1); position: relative; }
.album-item img, .album-item video { width: 100%; height: 100%; object-fit: cover; }

#presentationLobby { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: var(--bg-center); z-index: 15000; display: flex; flex-direction: column; padding: 20px; box-sizing: border-box; overflow-y: auto; }
.lobby-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--secondary); padding-bottom: 15px; margin-bottom: 15px; flex-wrap: wrap; gap: 10px; }
.lobby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; overflow-y: auto; padding-bottom: 80px; }
.lobby-item { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; cursor: pointer; border: 4px solid transparent; transition: 0.2s; background: #eee; }
.lobby-item img, .lobby-item video { width: 100%; height: 100%; object-fit: cover; }
.lobby-item.approved { border-color: var(--primary); }
.lobby-item.approved::after { content: '✅'; position: absolute; bottom: 5px; right: 5px; background: white; border-radius: 50%; padding: 2px; font-size: 0.9rem; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }
.lobby-item.rejected { opacity: 0.35; filter: grayscale(100%); }

/* NOVO: Placeholders perfeitos para vídeos v64 */
.video-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, var(--primary), var(--logo-blue)); display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 1rem; box-sizing: border-box; }
.video-placeholder span { font-size: 2rem; margin-bottom: 5px; }

#presentationMode { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: #000; z-index: 20000; display: flex; justify-content: center; align-items: center; flex-direction: column; }
#presentationMedia { width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; position: relative; overflow: hidden; }
#presentationMedia img, #presentationMedia video { position: absolute; max-width: 100vw; max-height: 100vh; width: auto; height: auto; object-fit: contain; border-radius: 0; z-index: 10; }
.slide-media { transition: opacity 1s ease-in-out; opacity: 0; z-index: 10; }
.slide-media.current { opacity: 1; z-index: 11; }

/* =========================================
   UI SECUNDÁRIA (BOTÕES E SWITCHES)
========================================= */
.toggle-container { display: flex; align-items: center; gap: 10px; font-weight: bold; background: #eafffa; padding: 10px 15px; border-radius: 10px; border: 1px solid var(--primary); font-size: 0.9rem; color: #2d5a52; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

.btn-group { display: flex; gap: 8px; width: 100%; justify-content: center; }
.btn-primary { background: var(--primary); color: white; border: none; padding: 12px 15px; border-radius: 8px; cursor: pointer; font-weight: bold; font-size: 0.95rem; transition: 0.3s; box-sizing: border-box; text-align: center; width: 100%; position: relative; z-index: 10; }
.btn-primary:hover { opacity: 0.9; transform: scale(0.98); }
.btn-secondary { background: var(--secondary); color: white; border: none; padding: 10px 12px; border-radius: 5px; cursor: pointer; font-weight: 600; font-size: 0.85rem; box-sizing: border-box; text-align: center; width: 100%; position: relative; z-index: 10; }
.btn-google { background: #ffffff; color: #444; border: 1px solid #ccc; padding: 12px 15px; border-radius: 8px; cursor: pointer; font-weight: bold; font-size: 0.95rem; transition: 0.3s; width: 100%; display: flex; justify-content: center; align-items: center; }
.btn-google:hover { background: #f1f1f1; }

.btn-toggle-panel { position: fixed; top: 15px; right: 15px; background: rgba(255, 255, 255, 0.9); border: none; padding: 8px 12px; border-radius: 20px; font-size: 0.85rem; cursor: pointer; z-index: 1000; font-weight: bold; color: var(--primary); box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.btn-toggle-panel.transparent { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.4); box-shadow: none; }
.btn-close-tv, .btn-cast-tv { position: absolute; background: rgba(255,255,255,0.2); color: white; border: none; padding: 10px 20px; border-radius: 30px; font-size: 1rem; cursor: pointer; z-index: 20001; backdrop-filter: blur(5px); }
.btn-close-tv { top: 20px; right: 20px; }
.btn-cast-tv { top: 20px; left: 20px; display: flex; align-items: center; gap: 8px; font-weight: bold; }

#uploadCard .btn-primary { width: 100% !important; margin: 0; } 
#uploadCard .btn-camera-green { background: var(--primary) !important; }
#uploadCard .btn-gallery-blue { background: var(--logo-blue) !important; }
.btn-gradient-verde { background: linear-gradient(135deg, #7ED3C2 0%, #6CC9D8 100%) !important; color: white !important; }
.btn-gradient-mistura-1 { background: linear-gradient(135deg, #6CC9D8 0%, #5BCEDF 100%) !important; color: white !important; }
.btn-gradient-mistura-2 { background: linear-gradient(135deg, #5BCEDF 0%, var(--logo-blue) 100%) !important; color: white !important; }
.btn-gradient-azul { background: linear-gradient(135deg, var(--logo-blue) 0%, #769EFF 100%) !important; color: white !important; }

/* =========================================
   TOUR GUIADO E ELEMENTOS (PIN, QR)
========================================= */
.tour-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 25000; pointer-events: auto; }
.tour-spotlight { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,0.75); transition: all 0.3s ease; pointer-events: none; border: 3px solid var(--primary); background: transparent; z-index: 25001; }
.tour-tooltip { position: fixed; background: white; padding: 18px; border-radius: 12px; width: 280px; z-index: 25002; box-shadow: 0 10px 40px rgba(0,0,0,0.4); font-size: 0.9rem; color: var(--text); transition: all 0.3s ease; left: 50%; transform: translateX(-50%); }
.tour-buttons { display: flex; justify-content: space-between; margin-top: 15px; align-items: center; }
.tour-btn { padding: 8px 15px; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; font-size: 0.85rem; transition: 0.2s; }
.tour-btn-skip { background: transparent; color: #888; text-decoration: underline; padding: 5px; }
.tour-btn-prev { background: #eee; color: #444; }
.tour-btn-next { background: var(--primary); color: white; }

.pin-input { width: 100%; max-width: 250px; padding: 10px; font-size: 1.2rem; text-align: center; font-weight: bold; letter-spacing: 3px; border: 2px solid var(--secondary); border-radius: 8px; margin: 0 auto 15px auto; color: var(--text); box-sizing: border-box; display: block; }
.pin-input:focus { border-color: var(--primary); outline: none; }
.guest-progress-container { width: 100%; background: #ddd; border-radius: 10px; height: 14px; overflow: hidden; margin: 10px 0; box-shadow: inset 0 1px 3px rgba(0,0,0,0.2); }
.guest-progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--secondary)); transition: width 0.2s ease; border-radius: 10px; }
.qr-container { display: flex; justify-content: center; align-items: center; background: white; padding: 10px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin: 0 auto 10px auto; width: fit-content; }
.stats-badge { background: #eafffa; border: 1px solid var(--primary); color: #2d5a52; padding: 8px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; margin-bottom: 5px; display: inline-block; }
.quality-container { text-align: left; margin-bottom: 10px; background: rgba(255, 255, 255, 0.5); padding: 8px 10px; border-radius: 10px; border: 1px solid var(--secondary); }
.quality-label { font-size: 0.8rem; font-weight: bold; color: var(--text); display: block; margin-bottom: 4px; }
.quality-selector, .guest-textarea { width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; background: #fff; color: var(--text); font-size: 0.85rem; outline: none; font-family: inherit; box-sizing: border-box; }
.guest-textarea { resize: none; margin-bottom: 10px; height: 48px; }
.access-denied-box { background: #fdf2f2 !important; border: 2px solid #d9534f !important; border-radius: 15px; padding: 20px; box-shadow: 0 8px 32px rgba(0,0,0,0.1); color: #4A4A4A; text-align: center; }

/* =========================================
   RODAPÉ E AVISO DE COOKIES
========================================= */
.app-footer { position: fixed; bottom: 0; left: 0; width: 100%; text-align: center; padding: 8px 0; font-size: 0.75rem; color: #888; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(8px); z-index: 100; border-top: 1px solid #eee; }
.terms-link { color: var(--primary); text-decoration: none; font-weight: bold; cursor: pointer; margin-left: 5px; }
.terms-link:hover { text-decoration: underline; color: var(--logo-blue); }

.cookie-banner { position: fixed; bottom: 40px; left: 0; width: 100%; background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(10px); box-shadow: 0 -4px 20px rgba(0,0,0,0.15); z-index: 99999; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 15px 20px; box-sizing: border-box; text-align: center; transform: translateY(150%); transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.cookie-banner.show { transform: translateY(0); }
.cookie-text { font-size: 0.8rem; color: #4A4A4A; margin-bottom: 12px; max-width: 800px; line-height: 1.4; }
.cookie-btn { background: var(--primary); color: white; border: none; padding: 10px 30px; border-radius: 20px; font-weight: bold; cursor: pointer; font-size: 0.9rem; transition: 0.3s; }

@media (min-width: 768px) {
    .btn-create-event { padding: 12px 24px; font-size: 1.05rem; }
    .logo-header { width: 180px; }
    .container { margin: 2vh auto; } 
    .cookie-banner { flex-direction: row; justify-content: space-between; text-align: left; padding: 15px 50px; bottom: 0; }
    .cookie-text { margin-bottom: 0; margin-right: 20px; font-size: 0.85rem; }
    .app-footer { background: rgba(255, 255, 255, 0.6); border: none; }
}
