/* 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;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {font-family: 'Poppins', sans-serif; background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%); min-height: 100vh; padding: 20px; margin: 0; box-sizing: border-box; color: var(--text-primary); transition: background-color 0.3s ease;}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 300;
  src: url('/assets/fonts/poppins/poppins.woff2') format('woff2');
  font-display: swap;
}

.check-li { list-style: none; position: relative; padding-left: 28px;}
.check-li::before { content: '✔'; color: #16c60c; font-size: 1.1em; position: absolute; left: 0; top: 0;}


.container { max-width: 900px; margin: 0 auto; }
/* CONTROLES SUPERIORES */
.controls-wrapper {position: fixed; top: 20px; right: 20px; z-index: 1000; display: flex; gap: 10px;}


.lang-switch {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 8px 15px;
    display: flex;
    gap: 10px;
    box-shadow: 0 4px 15px var(--card-shadow);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.3s;
}

.lang-btn:hover, .lang-btn.active {
    background: var(--primary);
    color: white;
}

.theme-toggle {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px var(--card-shadow);
    transition: all 0.3s;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    background: var(--primary);
    color: white;
}

/* HEADER */
.header {margin: 60px 0 40px 0; color: var(--text-inverse);}
.logo-container { font-size: 50px; margin-bottom: 20px; /*animation: bounce 2s infinite;*/}

@keyframes bounce { 0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }}

.header h1 { font-size: 2.5rem; margin-bottom: 10px; }
.subtitle { font-size: 1.1rem; opacity: 0.9; }

/* GLASS CARD */
.glass-card {
    background: var(--card-bg); /* color de respaldo */
    backdrop-filter: blur(8px); /* blur un poco más suave */
    border-radius: 20px;
    padding: 30px 40px; 
    margin-bottom: 30px;
    box-shadow: 0 8px 24px var(--card-shadow); 
    min-height: 400px;
    width: 100%;
    box-sizing: border-box;
    transition: background-color 0.3s ease; /* transición suave para cambios de tema */
}


.card-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* FORMULARIOS */
.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.form-control,
input[type="tel"],
input[type="text"],
select,
textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--input-border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.3s;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--input-focus-border);
    background: var(--input-focus-bg);
}

textarea { min-height: 120px; resize: vertical; }

.char-count {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 5px;
    text-align: right;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* BOTONES */
.button-group {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(37, 211, 102, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.3s;
}

.btn-icon:hover {
    transform: scale(1.1);
}

button.template-btn{
    background: var(--card-bg);
    border: var(--border-color);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: 0.3s;}
    
/* ============================================
   HISTORIAL DE NÚMEROS - CLASES ORIGINALES
   ============================================ */

/* Mensaje cuando está vacío */
.history-empty {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    text-align: center;
    padding: 20px;
}

[data-theme="dark"] .history-empty {
    color: rgba(255, 255, 255, 0.4);
}

/* Label del historial */
.history-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

[data-theme="dark"] .history-label {
    color: rgba(255, 255, 255, 0.6);
}

/* Grid de botones de historial */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

/* Botón individual del historial */
.history-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    padding: 8px 12px;
    border: 1px solid rgba(37, 211, 102, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 5px;
}

.history-btn:hover {
    background: rgba(37, 211, 102, 0.3);
    border-color: #25D366;
}

[data-theme="dark"] .history-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .history-btn:hover {
    background: rgba(37, 211, 102, 0.2);
    border-color: #25D366;
}

/* Número dentro del botón */
.history-number {
    flex: 1;
    cursor: pointer;
}

/* Botón eliminar (×) */
.history-delete {
    background: rgba(220, 53, 69, 0.8);
    border: none;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    margin-left: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-weight: bold;
}

.history-delete:hover {
    background: #dc3545;
    transform: scale(1.2);
}

[data-theme="dark"] .history-delete {
    background: rgba(220, 53, 69, 0.9);
}

[data-theme="dark"] .history-delete:hover {
    background: #e74c3c;
}

/* HISTORIAL */
.number-history {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 50px;
}

.number-chip {
    background: var(--primary);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.number-chip:hover {
    background: var(--secondary);
    transform: scale(1.05);
}

/* PLANTILLAS */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.template-card {
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s;
}

.template-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 5px 20px var(--card-shadow);
}

.template-card h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.template-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 15px;
}

.btn-use-template {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-use-template:hover {
    background: var(--secondary);
}

/* CARACTERÍSTICAS */
.content-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px var(--card-shadow);
}

.content-section h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-section h3 {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 10px;
}

.content-section p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.feature-card {
    background: var(--input-bg);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border-left: 4px solid var(--primary);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px var(--card-shadow);
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.steps-list {
    padding-left: 30px;
    color: var(--text-secondary);
    line-height: 2;
}

.steps-list li {
    margin-bottom: 10px;
}

/* FOOTER */
footer {
    text-align: center;
    color: var(--text-inverse);
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

footer a {
    color: var(--text-inverse);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* BANNER PWA */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    padding: 15px 20px;
    box-shadow: 0 -4px 15px var(--card-shadow);
    display: none;
    z-index: 999;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.install-banner.show { display: flex; align-items: center; justify-content: space-between; }

.install-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.install-icon { font-size: 32px; }

.install-text h3 {
    margin: 0;
    color: var(--text-primary);
}

.install-text p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.install-actions { display: flex; gap: 10px; }

.btn-install {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-dismiss {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-submit{width:100%;background:linear-gradient(135deg,var(--primary),var(--secondary));color:white;border:none;padding:16px;border-radius:12px;font-size:18px;font-weight:600;cursor:pointer;transition:all 0.3s;box-shadow:0 4px 15px rgba(37,211,102,0.4);display:flex;align-items:center;justify-content:center;gap:10px;}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.show { display: flex; }

.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
}

.modal-content h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

#install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #25D366;
  color: white;
  text-align: center;
  padding: 12px 0;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  user-select: none;
}

#install-btn {
  background: white;
  color: #25D366;
  border: none;
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 16px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

#install-btn:hover {
  background-color: #1ebe57;
  color: white;
}


/* RESPONSIVE */
@media (max-width: 768px) {
    .controls-wrapper { flex-direction: column; gap: 5px; }
    .header { margin-top: 0px; }
    .button-group { flex-direction: column; }
    .install-banner { flex-direction: column; text-align: center; }
    .install-content { flex-direction: column; }
    .history-grid {grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 6px;}
    .history-btn {padding: 6px 10px;font-size: 12px;}
    .history-delete {width: 20px; height: 20px; font-size: 14px;}
}