/* VARIABLES DE TEMA */
:root {
    --bg-gradient-start: #667eea;
    --bg-gradient-mid: #764ba2;
    --bg-gradient-end: #f093fb;
    --text-primary: #2c3e50;
    --text-secondary: #5a6c7d;
    --text-tertiary: #95a5a6;
    --text-inverse: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-shadow: rgba(0, 0, 0, 0.1);
    --border-color: #e0e0e0;
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --input-focus-bg: #f0fff4;
    --input-focus-border: #25D366;
    --primary: #25D366;
    --secondary: #128C7E;
    --danger: #dc3545;
}

[data-theme="dark"] {
    --bg-gradient-start: #0f0f1e;
    --bg-gradient-mid: #1a1a2e;
    --bg-gradient-end: #16213e;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-tertiary: #808080;
    --text-inverse: #e0e0e0;
    --card-bg: rgba(30, 30, 40, 0.95);
    --card-shadow: rgba(0, 0, 0, 0.6);
    --border-color: #3a3a4a;
    --input-bg: #2d2d3d;
    --input-border: #3a3a4a;
    --input-focus-bg: #1a3a2e;
    --input-focus-border: #25D366;
}

/* Estilos para Historia y Plantillas Personalizadas */

.history-container {
    margin-bottom: 20px;
}



.custom-template-section {
    margin: 20px 0;
    background: rgba(37, 211, 102, 0.05);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(37, 211, 102, 0.2);
}

.custom-template-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-add-template {
    background: linear-gradient(135deg, #25D366, #128C7E);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.btn-add-template:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.custom-templates-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.custom-template-btn {
    position: relative;
    font-size: 12px;
    display: inline-block;
    transition: all 0.2s;
}

.custom-template-btn:hover {
    transform: translateY(-2px);
}

/* Selector de País mejorado */
.iti {
    width: 100%;
}



/* Selector de emojis mejorado */
.emoji-picker {
    position: absolute;
    bottom: 55px;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    display: none;
    z-index: 1000;
    width: 280px;
    animation: slideUp 0.3s ease;
}

.emoji-picker.show {
    display: block;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
    gap: 5px;
    max-height: 220px;
    overflow-y: auto;
}

.emoji-item {
    font-size: 1.4rem;
    cursor: pointer;
    padding: 5px;
    text-align: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.emoji-item:hover {
    background: rgba(37, 211, 102, 0.2);
    transform: scale(1.2);
}

.btn-emoji {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-emoji:hover {
    transform: scale(1.15);
    background: rgba(37, 211, 102, 0.4);
}

.textarea-wrapper {
    position: relative;
}


/* Responsive */
@media (max-width: 768px) {
    .history-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}


/* Checkboxes mejorados */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    margin: 20px 0;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #25D366;
}

/* Animaciones */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* Responsive */
@media (max-width: 768px) {
    .custom-template-form {
        flex-direction: column;
    }

    .btn-add-template {
        width: 100%;
        justify-content: center;
    }

    .emoji-picker {
        width: 260px;
        right: auto;
        /*left: 50%;*/
    }

    .history-container {
        max-height: 200px;
        overflow-y: auto;
    }
}

/* Grid de historial */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}
