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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #1a472a 0%, #0d2818 100%);
    color: #fff;
    min-height: 100vh;
    height: 100vh;
    margin: 0;
    padding: 0;
    position: relative;
    overflow: hidden;
}

/* Efecto de nieve */
.snow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent);
    background-size: 200px 200px, 300px 300px, 250px 250px, 350px 350px, 280px 280px;
    animation: snow 20s linear infinite;
    opacity: 0.6;
    z-index: 1;
}

@keyframes snow {
    0% { background-position: 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px; }
    100% { background-position: 200px 400px, 300px 600px, 250px 500px, 350px 700px, 280px 550px; }
}

.container {
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 2;
}

/* Selector de idiomas */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.lang-btn {
    background: transparent;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn .flag {
    font-size: 24px;
    display: block;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Layout principal */
.main-content {
    position: relative;
    width: 100%;
    height: 100vh;
}

/* Sección del árbol - Pantalla completa */
.tree-section-fullscreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#treeCanvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    cursor: grab;
}

#treeCanvas:active {
    cursor: grabbing;
}

/* Paneles flotantes */
.floating-panel {
    position: fixed;
    bottom: 90px;
    right: -450px;
    width: 420px;
    max-height: 70vh;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.5);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.floating-panel.active {
    right: 20px;
}

.panel-header {
    background: linear-gradient(135deg, #c41e3a 0%, #8b1729 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.3em;
    color: white;
}

.close-panel {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2em;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    line-height: 1;
}

.close-panel:hover {
    background: rgba(255, 255, 255, 0.3);
}

.panel-content {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

/* Botones flotantes inferiores */
.floating-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    z-index: 99;
}

.fab {
    background: linear-gradient(135deg, #c41e3a 0%, #8b1729 100%);
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    color: white;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.6);
}

.fab:active {
    transform: translateY(-1px);
}

.fab-icon {
    font-size: 1.3em;
}

.fab-label {
    font-size: 0.95em;
}

/* Lista de deseos */
.wishes-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Formulario */
.form-group {
    margin-bottom: 20px;
}

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

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

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #c41e3a;
}

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

/* Botones */
.btn-submit, .btn-search {
    background: linear-gradient(135deg, #c41e3a 0%, #8b1729 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(196, 30, 58, 0.3);
}

.btn-submit:hover, .btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(196, 30, 58, 0.5);
}

.btn-submit:active, .btn-search:active {
    transform: translateY(0);
}

.btn-submit {
    width: 100%;
}

.btn-secondary {
    background: linear-gradient(135deg, #2d5016 0%, #1a3d0f 100%);
}

/* Búsqueda */
.search-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.search-group input {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 2px solid #2d5016;
    border-radius: 8px;
    font-size: 1em;
}

.wish-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #c41e3a;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wish-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.wish-name {
    color: #c41e3a;
    font-weight: bold;
    font-size: 1.1em;
}

.wish-date {
    color: #666;
    font-size: 0.85em;
}

.wish-text {
    color: #333;
    line-height: 1.6;
    font-size: 1em;
}

.loading {
    text-align: center;
    color: #666;
    padding: 20px;
}

.no-wishes {
    text-align: center;
    color: #666;
    padding: 30px;
    font-style: italic;
}

.wishes-summary {
    text-align: center;
    color: #2d5016;
    padding: 30px;
    font-size: 1.2em;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 10px;
    border: 2px solid #2d5016;
}

/* Scrollbar personalizada */
.wishes-list::-webkit-scrollbar {
    width: 8px;
}

.wishes-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.wishes-list::-webkit-scrollbar-thumb {
    background: #c41e3a;
    border-radius: 10px;
}

.wishes-list::-webkit-scrollbar-thumb:hover {
    background: #8b1729;
}

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

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

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    margin: auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s;
    position: relative;
}

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

.modal-header {
    background: linear-gradient(135deg, #c41e3a 0%, #8b1729 100%);
    color: white;
    padding: 25px;
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8em;
    color: white;
}

.modal-fecha {
    margin: 8px 0 0 0;
    opacity: 0.9;
    font-size: 0.9em;
}

.modal-body {
    padding: 30px;
    color: #333;
    font-size: 1.1em;
    line-height: 1.8;
    max-height: 400px;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    color: white;
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
    z-index: 1;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .floating-panel {
        width: calc(100% - 20px);
        right: -100%;
        bottom: 80px;
    }
    
    .floating-panel.active {
        right: 10px;
    }
    
    .floating-buttons {
        right: 10px;
        bottom: 10px;
        flex-direction: row;
        gap: 10px;
    }
    
    .fab {
        padding: 12px 20px;
        font-size: 0.9em;
    }
    
    .fab-icon {
        font-size: 1.2em;
    }
}
