/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    transition: all 0.3s ease;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Variáveis CSS para Temas */
.theme-love {
    --primary-color: #FF6B6B;
    --secondary-color: #FFE3E3;
    --accent-color: #5E60CE;
    --text-color: #333;
    --bg-color: #fff;
    --card-bg: #FFE3E3;
    --border-color: #FF6B6B;
}

.theme-solo {
    --primary-color: #666;
    --secondary-color: #222;
    --accent-color: #AAA;
    --text-color: #AAA;
    --bg-color: #111;
    --card-bg: #222;
    --border-color: #666;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Tipografia */
h1, h2, h3 {
    font-family: 'Pacifico', cursive;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2rem;
    text-align: center;
}

h2 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.2rem;
}

p {
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* Telas de Gate */
.gate-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.gate-screen.active {
    opacity: 1;
    visibility: visible;
}

.gate-container {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.gate-title {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.gate-subtitle {
    color: var(--text-color);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Input de Data */
.date-input-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

#date-input {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1.1rem;
    text-align: center;
    background: var(--bg-color);
    color: var(--text-color);
    transition: all 0.2s ease;
}

#date-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(94, 96, 206, 0.2);
}

#confirm-date, .music-btn {
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
}

#confirm-date:hover, .music-btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

#confirm-date:focus, .music-btn:focus {
    outline: 3px solid rgba(94, 96, 206, 0.5);
    outline-offset: 2px;
}

#confirm-date:active, .music-btn:active {
    transform: translateY(0);
}

/* Mensagem de Erro */
.error-message {
    color: #e74c3c;
    font-weight: 500;
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animação de Shake */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Conteúdo Principal */
.main-content {
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    min-height: 100vh;
}

.main-content.active {
    opacity: 1;
    visibility: visible;
}

/* Seção Herói */
.hero-section {
    position: relative;
    padding: 2rem 1rem;
    text-align: center;
    background: linear-gradient(135deg, var(--secondary-color), var(--bg-color));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.main-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 1rem;
    line-height: 1.7;
}

.signature {
    font-style: italic;
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 3rem;
}

/* Toggle de Tema */
.theme-toggle-container {
    margin: 2rem 0;
}

.theme-toggle {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    padding: 1rem 3.5rem 1rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 48px;
    font-size: 1rem;
    color: var(--text-color);
}

.theme-toggle:hover {
    transform: scale(1.05);
}

.theme-toggle:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

.toggle-text {
    display: block;
    font-weight: 500;
}

.toggle-slider {
    position: absolute;
    top: 50%;
    right: 1.5rem;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-solo .toggle-slider {
    right: calc(100% - 2rem);
}

.toggle-description {
    font-size: 0.8rem;
    color: var(--accent-color);
    text-align: center;
    margin-top: 0.5rem;
    opacity: 0.8;
    font-style: italic;
}

/* Poema */
.poem-container {
    margin: 2rem 0;
}

.poem {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--accent-color);
    line-height: 1.8;
    max-width: 400px;
    margin: 0 auto;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 15px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.theme-solo .poem {
    animation: subtle-shake 3s ease-in-out infinite;
}

@keyframes subtle-shake {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(1px); }
}

/* Corações Flutuantes */
.floating-hearts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.theme-love .floating-hearts::before,
.theme-love .floating-hearts::after {
    content: '💖';
    position: absolute;
    font-size: 2rem;
    animation: float-hearts 6s ease-in-out infinite;
    opacity: 0.7;
}

.theme-love .floating-hearts::before {
    left: 10%;
    animation-delay: 0s;
}

.theme-love .floating-hearts::after {
    right: 10%;
    animation-delay: 3s;
}

@keyframes float-hearts {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Frases Flutuantes */
.floating-phrases {
    position: absolute;
    top: 20%;
    left: 0;
    width: 100%;
    height: 60%;
    pointer-events: none;
}

.floating-phrase {
    position: absolute;
    background: var(--card-bg);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: float-phrase 4s ease-in-out forwards;
    opacity: 0;
}

@keyframes float-phrase {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateY(-10px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px) scale(0.8);
    }
}

/* Controles de Música */
.music-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: none;
    gap: 0.5rem;
    z-index: 100;
}

.music-controls.active {
    display: flex;
}

.control-btn {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.control-btn:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* Seções Principais */
section {
    padding: 3rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.counter-section {
    text-align: center;
    background: var(--card-bg);
    border-radius: 20px;
    margin: 2rem 1rem;
}

.days-counter {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

#days-count {
    font-family: 'Pacifico', cursive;
    font-size: 2rem;
    color: var(--accent-color);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 2rem;
}

.timeline-item::before {
    content: '💖';
    position: absolute;
    left: -2.5rem;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: var(--bg-color);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.timeline-date {
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.timeline-content {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

/* Carta */
.letter {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid var(--border-color);
    font-size: 1.1rem;
    line-height: 1.8;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.letter-signature {
    text-align: right;
    font-style: italic;
    color: var(--accent-color);
    margin-top: 1rem;
}

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 4rem 1rem;
}

.cta-button {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    padding: 1.5rem 3rem;
    font-size: 1.3rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    min-height: 48px;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.cta-button:focus {
    outline: 3px solid rgba(94, 96, 206, 0.5);
    outline-offset: 2px;
}

.cta-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.cta-response {
    margin-top: 2rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    opacity: 0;
    transition: all 0.3s ease;
}

.cta-response.active {
    opacity: 1;
    transform: scale(1.1);
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.confetti-heart {
    position: absolute;
    font-size: 2rem;
    animation: confetti-fall 3s ease-out forwards;
    pointer-events: none;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
    border-top: 2px solid var(--border-color);
}

.heart-button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.2rem;
    border-radius: 50%;
}

.heart-button:hover {
    transform: scale(1.2);
}

.heart-button:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Easter Egg Background */
.easter-egg-bg {
    background-image: url('assets/foto1.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.easter-egg-bg::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

/* Responsividade */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .poem {
        font-size: 1rem;
        padding: 1rem;
    }
    
    .timeline {
        padding-left: 1rem;
    }
    
    .timeline-item {
        padding-left: 1.5rem;
    }
    
    .timeline-item::before {
        left: -2rem;
    }
    
    .cta-button {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
    
    section {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    .gate-container {
        padding: 1.5rem;
    }
    
    .main-title {
        font-size: 1.8rem;
    }
    
    .date-input-container {
        gap: 0.8rem;
    }
    
    #date-input, #confirm-date, .music-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .music-controls {
        top: 10px;
        right: 10px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Estados de Foco Melhorados */
*:focus {
    outline-offset: 2px;
}

button:focus,
input:focus {
    outline: 2px solid var(--accent-color);
}

/* Transições Suaves */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* Melhorias de Performance */
.floating-hearts,
.floating-phrases,
.confetti-container {
    will-change: transform;
}

.theme-toggle,
.cta-button,
.control-btn {
    will-change: transform;
}