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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a472a 0%, #2d5a3d 100%);
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Flocos de Neve */
@keyframes fall {
    to {
        transform: translateY(100vh) rotateZ(360deg);
        opacity:0;
    }
}

.snowflake {
    position: fixed;
    top: -10px;
    color: white;
    font-size: 1.5em;
    animation: fall linear infinite;
    pointer-events: none;
    z-index: 999;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.user-avatar {
    font-size: 1.5em;
    cursor: pointer;
}

/* Layout Principal */
.main-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 5;
}

/* Main Content */
.main-content {
    width: 100%;
}

.tree-container {
    margin-bottom: 40px;
    position: relative;
    z-index: 10;
}

.title {
    text-align: left;
    color: white;
    font-size: 2em;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Cena da Árvore */
.tree-scene {
    position: relative;
    min-height: 650px;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 20px;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
    padding-left: 0;
    padding-right: 0;
}

/* Background da cena com montanhas e árvores */
.scene-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    pointer-events: none;
}

.mountains-bg {
    position: absolute;
    bottom: -90px;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    z-index: 1;
    opacity: 0.8;
    object-fit: cover;
}

.trees-bg {
    position: absolute;
    bottom: -100px;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    z-index: 2;
    opacity: 0.7;
    object-fit: cover;
}

/* Sombrinha no pé da árvore */
.tree-backdrop {
    position: absolute;
    bottom: -70px;
    left: 50%;
    transform: translateX(-50%);
    width: 420px;
    max-width: 90%;
    height: 140px;
    background: 
        linear-gradient(180deg,
            rgba(200, 200, 200, 0.6) 0%,
            rgba(180, 180, 180, 0.5) 50%,
            rgba(160, 160, 160, 0.3) 100%);
    border: 3px solid rgba(100, 100, 100, 0.5);
    border-radius: 50%;
    z-index: 4;
    box-shadow: 
        inset 0 2px 10px rgba(255, 255, 255, 0.3),
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.tree-background {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 550px;
    height: 650px;
    background-image: url('arvore.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    pointer-events: none;
    z-index: 8;
}

.tree-ornaments-overlay {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 550px;
    height: 650px;
    z-index: 10;
}

/* Ornamentos SVG */
.ornament-circle {
    cursor: pointer;
    transition: filter 0.3s ease, r 0.3s ease;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.ornament-circle:hover {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

.ornament-circle:hover + circle {
    opacity: 0.7;
}

/* Mensagens */
.messages-section {
    margin-top: 40px;
    position: relative;
    z-index: 60; /* aumentado para ficar acima de montanhas/tress-bg */
}

.messages-section h2 {
    position: relative;
    z-index: 61; /* garante o título na frente */
    margin-bottom: 30px;
    color: white;
    font-size: 1.8em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.messages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 0 20px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Post-it Style Cards */
.message-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    transform: perspective(800px) rotateY(0deg) rotateX(0deg);
    position: relative;
    z-index: 62; /* aumentado para garantir que o card fique à frente do background */
}

.message-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}


.message-card-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    margin-top: 8px;
    font-size: 1.1em;
    font-style: italic;
}

.message-card-text {
    color: #444;
    line-height: 1.7;
    word-wrap: break-word;
    padding-top: 15px;
    min-height: 200px;
    display: flex;
    align-items: flex-start;
}

.message-card-content {
    padding: 20px;
    position: relative;
    z-index: 0;
}

.message-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 0;
}

.message-card-heart {
    font-size: 1.5em;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.message-card-heart:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 4px rgba(255, 0, 0, 0.6));
}

.message-card-heart.liked {
    animation: heartBeat 0.3s ease;
}

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

.message-card-heart span {
    font-size: 0.9em;
    font-weight: bold;
    min-width: 30px;
}

/* Cores diferentes para cada card */
.message-card-red {
    background: linear-gradient(135deg, #c41e3a 0%, #a01830 100%);
}

.message-card-red .message-card-name,
.message-card-red .message-card-text {
    color: white;
}

.message-card-red .message-card-footer {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.message-card-red .message-card-author {
    color: rgba(255, 255, 255, 0.9);
}

.message-card-blue {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.message-card-blue .message-card-name,
.message-card-blue .message-card-text {
    color: white;
}

.message-card-blue .message-card-footer {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.message-card-blue .message-card-author {
    color: rgba(255, 255, 255, 0.9);
}

.message-card-purple {
    background: linear-gradient(135deg, #d946ef 0%, #c026d3 100%);
}

.message-card-purple .message-card-name,
.message-card-purple .message-card-text {
    color: white;
}

.message-card-purple .message-card-footer {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.message-card-purple .message-card-author {
    color: rgba(255, 255, 255, 0.9);
}

.message-card-teal {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
}

.message-card-teal .message-card-name,
.message-card-teal .message-card-text {
    color: white;
}

.message-card-teal .message-card-footer {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.message-card-teal .message-card-author {
    color: rgba(255, 255, 255, 0.9);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: rgb(255, 255, 255);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    min-height: 300px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideIn 0.3s ease;
}

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

.modal-content h2 {
    color: #0B6623;
    margin-bottom: 20px;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #000;
}

/* Formulário */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0B6623;
    box-shadow: 0 0 8px rgba(11, 118, 35, 0.2);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* Botões */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel {
    background-color: #ddd;
    color: #333;
}

.btn-cancel:hover {
    background-color: #ccc;
}

.btn-submit {
    background-color: #0B6623;
    color: white;
}

.btn-submit:hover {
    background-color: #0D7D2F;
    transform: scale(1.05);
}

.btn-submit:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: scale(1);
}

/* Botão Flutuante */
.floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background: linear-gradient(135deg, #8B4513, #A0522D);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 500;
}

.floating-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.floating-btn:active {
    transform: translateY(0);
}

/* Background branco/neve - Normal (sem parallax, não fixo) */
body::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1600px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(245, 250, 255, 0.8) 15%, rgba(240, 248, 255, 1) 100%);
    pointer-events: none;
    z-index: 3;
}

/* Rodapé */
.footer {
    background: rgba(26, 71, 42, 0.95);
    padding: 20px;
    text-align: center;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    margin-top: 40px;
    position: relative;
    z-index: 6;
}

.footer p {
    color: white;
    font-size: 0.95em;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Responsivo */

/* Smartphones (320px - 480px) */
@media (max-width: 480px) {
    .title {
        font-size: 1.2em;
    }

    .tree-scene {
        min-height: 550px;
    }

    .tree-background,
    .tree-ornaments-overlay {
        max-width: 100%;
        height: 450px;
    }

    .tree-backdrop {
        max-width: 100%;
        height: 200px;
    }

    .messages-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 10px;
    }

    .message-card {
        margin: 0;
    }

    .floating-btn {
        bottom: 15px;
        right: 15px;
        padding: 10px 16px;
        font-size: 0.85em;
    }

    body::before {
        height: 350px;
    }

    .header {
        padding: 10px 15px;
    }

    .logo {
        font-size: 1.2em;
    }
}

/* Tablets (481px - 768px) */
@media (max-width: 768px) {
    .title {
        font-size: 1.5em;
    }

    .tree-scene {
        min-height: 650px;
    }

    .tree-background,
    .tree-ornaments-overlay {
        max-width: 100%;
        height: 550px;
    }

    .tree-backdrop {
        max-width: 100%;
        height: 280px;
    }

    .messages-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
        padding: 0 15px;
    }

    .floating-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        font-size: 0.9em;
    }

    body::before {
        height: 400px;
    }
}

/* Desktop (769px+) */
@media (min-width: 769px) {
    .messages-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 30px;
        padding: 0 20px;
    }
}

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .messages-grid {
        grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
        gap: 35px;
        padding: 0 40px;
    }
}
