:root {
    /* Paleta de Cores Premium (Romântica / Moderna) */
    --primary-rose: #ff4d6d;
    --primary-rose-hover: #ff758f;
    --primary-gold: #ffd166;
    --bg-dark-gradient: linear-gradient(135deg, #0f051d 0%, #290a21 50%, #450c26 100%);
    --text-light: #f8f9fa;
    --text-muted: #c9ada7;
    
    /* Cores Pastel para Cartões de Dedicatórias */
    --pastel-pink: rgba(255, 182, 193, 0.25);
    --pastel-peach: rgba(255, 218, 185, 0.25);
    --pastel-purple: rgba(221, 160, 221, 0.25);
    --pastel-blue: rgba(173, 216, 230, 0.25);
    
    --pastel-pink-border: rgba(255, 182, 193, 0.5);
    --pastel-peach-border: rgba(255, 218, 185, 0.5);
    --pastel-purple-border: rgba(221, 160, 221, 0.5);
    --pastel-blue-border: rgba(173, 216, 230, 0.5);

    /* Efeitos */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-blur: blur(12px);
    
    /* Fontes */
    --font-handwritten: 'Great Vibes', cursive;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-dark-gradient);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Fundo Animado com Partículas (Corações) */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.heart-particle {
    position: absolute;
    color: var(--primary-rose);
    opacity: 0.6;
    animation: floatUp linear forwards;
    pointer-events: none;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) rotate(0deg) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-10vh) rotate(360deg) scale(1.2);
        opacity: 0;
    }
}

/* Efeito de Vidro (Glassmorphism) */
.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    width: 100%;
    padding: 40px 20px 20px 20px;
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
}

.header-container {
    max-width: 900px;
    width: 100%;
    padding: 40px;
    text-align: center;
    border: 1px solid rgba(255, 77, 109, 0.15);
}

.romantic-title {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #ff4d6d, #ffd166, #ff758f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 300;
    margin-bottom: 30px;
}

/* Contador de Tempo */
.counter-container {
    margin: 20px 0 30px 0;
}

.counter-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-rose-hover);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.counter-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    max-width: 650px;
    margin: 0 auto;
}

.counter-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.counter-item:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 77, 109, 0.3);
}

.counter-item span {
    font-size: 2rem;
    font-weight: 600;
    font-family: var(--font-serif);
    color: var(--text-light);
}

.counter-item label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 5px;
    letter-spacing: 1px;
}

/* Player de Música */
.music-player {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 77, 109, 0.08);
    border: 1px solid rgba(255, 77, 109, 0.2);
    border-radius: 50px;
    padding: 8px 20px;
    margin-top: 10px;
    gap: 15px;
    max-width: 100%;
}

.music-control-btn {
    background: var(--primary-rose);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.music-control-btn:hover {
    transform: scale(1.1);
    background: var(--primary-rose-hover);
}

.music-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.music-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.music-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Seções */
section {
    padding: 40px;
    margin-bottom: 40px;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 35px;
}

.section-header h2 {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    margin-bottom: 8px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.section-header p {
    color: var(--text-muted);
    font-weight: 300;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: var(--font-sans);
}

.btn-primary {
    background: var(--primary-rose);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-rose-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 77, 109, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-rose);
    transform: translateY(-2px);
}

.btn-google {
    background: #4285f4;
    color: white;
}

.btn-google:hover {
    background: #357ae8;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.4);
}

.btn-link-danger {
    background: transparent;
    color: #ff4d6d;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.btn-link-danger:hover {
    opacity: 0.8;
}

.settings-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    margin-top: 15px;
}

.settings-btn:hover {
    background: var(--primary-rose);
    color: white;
    border-color: var(--primary-rose);
}

/* Formulário de Dedicatórias */
.dedication-form {
    max-width: 650px;
    margin: 0 auto 40px auto;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 25px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-family: var(--font-sans);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary-rose);
    box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.25);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker-wrapper label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.color-options {
    display: flex;
    gap: 8px;
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.color-dot:hover {
    transform: scale(1.15);
}

.color-dot.active {
    border-color: var(--text-light);
    transform: scale(1.1);
}

/* Grid de Dedicatórias (Mural de Cartões) */
.dedications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.dedication-card {
    border-radius: 18px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
    display: flex;
    flex-direction: column;
}

.dedication-card:hover {
    transform: translateY(-8px) rotate(1deg);
    box-shadow: 0 15px 30px rgba(255, 77, 109, 0.15);
}

.dedication-card::before {
    content: "❤️";
    position: absolute;
    top: 10px;
    right: 15px;
    opacity: 0.15;
    font-size: 1.5rem;
}

.card-message {
    font-family: var(--font-handwritten);
    font-size: 1.6rem;
    line-height: 1.4;
    color: var(--text-light);
    flex-grow: 1;
    margin-bottom: 20px;
    word-break: break-word;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 10px;
    margin-top: auto;
}

.card-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-light);
}

.card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.delete-card-btn {
    position: absolute;
    bottom: 10px;
    right: 15px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.dedication-card:hover .delete-card-btn {
    opacity: 1;
}

.delete-card-btn:hover {
    color: var(--primary-rose);
}

/* Tipos de Cores dos Cartões */
.card-pink {
    background: var(--pastel-pink);
    border: 1px solid var(--pastel-pink-border);
}
.card-peach {
    background: var(--pastel-peach);
    border: 1px solid var(--pastel-peach-border);
}
.card-purple {
    background: var(--pastel-purple);
    border: 1px solid var(--pastel-purple-border);
}
.card-blue {
    background: var(--pastel-blue);
    border: 1px solid var(--pastel-blue-border);
}

/* Seção de Fotos */
.photo-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 15px 25px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.fallback-upload-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.google-status-panel {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.25);
    border-radius: 12px;
    padding: 10px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.google-status-panel span {
    color: #2ecc71;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Pinterest Grid para fotos */
.photos-grid {
    column-count: 3;
    column-gap: 20px;
    margin-top: 20px;
}

.photo-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    margin-bottom: 20px;
    break-inside: avoid;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: zoom-in;
}

.photo-item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

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

.photo-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    padding: 20px 15px 15px 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.photo-caption {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.photo-date {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
}

.delete-photo-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 2;
}

.photo-item:hover .delete-photo-btn {
    opacity: 1;
}

.delete-photo-btn:hover {
    background: var(--primary-rose);
}

/* Modais */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    max-width: 500px;
    width: 90%;
    padding: 35px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.85);
    transition: transform 0.3s ease;
}

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

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.close-modal-btn:hover {
    color: var(--primary-rose);
}

.modal h3 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    line-height: 1.5;
}

.modal ol {
    margin-left: 20px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.modal a {
    color: var(--primary-rose-hover);
    text-decoration: none;
}

.modal a:hover {
    text-decoration: underline;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
}

/* 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;
    cursor: zoom-out;
}

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

.lightbox-caption {
    margin-top: 20px;
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    padding: 0 20px;
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
}

/* Utilitários */
.hidden {
    display: none !important;
}

.animate-pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* Responsividade */
@media (max-width: 900px) {
    .photos-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .photos-grid {
        column-count: 1;
    }
    
    .romantic-title {
        font-size: 2.5rem;
    }
    
    .counter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    section {
        padding: 20px;
    }
    
    .photo-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .fallback-upload-container {
        flex-direction: column;
    }
}

/* Quando não estiver em modo admin, esconde os botões e formulários administrativos */
body:not(.admin-mode) .admin-only {
    display: none !important;
}
body:not(.admin-mode) .delete-card-btn,
body:not(.admin-mode) .delete-photo-btn {
    display: none !important;
}

/* Tela de Entrada Restrita (Gatekeeper) */
.gatekeeper-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-dark-gradient);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.gatekeeper-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.gatekeeper-card {
    max-width: 450px;
    width: 90%;
    padding: 40px;
    text-align: center;
    border: 1px solid rgba(255, 77, 109, 0.2);
}

.heart-pulse-large {
    font-size: 4.5rem;
    color: var(--primary-rose);
    margin-bottom: 20px;
    animation: heartBeatLarge 1.2s infinite;
}

.error-msg {
    color: #ff4d6d;
    font-size: 0.9rem;
    margin-top: 15px;
    animation: shakeGate 0.4s ease;
}

@keyframes heartBeatLarge {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.12); }
    40% { transform: scale(1.05); }
    60% { transform: scale(1.18); }
}

@keyframes shakeGate {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
    50%, 90% { transform: translateX(8px); }
}

.admin-badge {
    background: rgba(255, 77, 109, 0.15);
    border: 1px solid rgba(255, 77, 109, 0.3);
    color: var(--primary-rose-hover);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
