/* Color palette - Artesanía mexicana inspired */
:root {
    --primary-color: #E4007C; /* Rosa mexicano */
    --primary-dark: #C0006A; /* Rosa mexicano más oscuro */
    --secondary-color: #00A86B; /* Verde jade */
    --accent-color: #FF5733; /* Naranja cálido */
    --highlight-color: #30D5C8; /* Azul turquesa */
    --text-color: #333;
    --light-bg: #f9f9f9;
    --border-color: #ddd;
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
}

/* Header */
header {
    text-align: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon {
    height: 32px;
    width: 32px;
    vertical-align: middle;
    margin-right: 10px;
    object-fit: contain;
}

/* Main content */
main {
    padding: 10px 20px 20px 20px;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    text-align: center;
}

h3 {
    font-size: 1.1rem;
    margin: 20px 0 10px;
    color: #555;
}

/* Input area */
.input-container {
    position: relative;
    margin-bottom: 30px; /* Increased to accommodate the character counter */
}

.input-container .char-counter {
    position: absolute;
    bottom: -22px;
    right: 0;
    font-size: 0.85rem;
    color: #777;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: none;
    height: 120px;
    font-size: 1rem;
}

.mic-button {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #777;
    cursor: pointer;
}

.mic-button:hover {
    color: var(--primary-color);
}

/* Tone selector */
.tone-selector {
    margin-bottom: 20px;
}

/* Tone header */
.tone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* Tone filter */
.tone-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.9rem;
    color: #666;
    cursor: pointer;
}

.tone-selector .collapsible-container {
    margin-top: 10px;
}

.tone-select-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    width: 100%;
}

.tone-selector label {
    font-weight: bold;
    white-space: nowrap;
}

.tone-select-container select {
    flex: 2;
    max-width: none;
    height: 42px;
    line-height: 1;
    padding: 0 12px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

#saveFavoriteButton {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 42px;
    line-height: 1;
    padding: 0 12px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-left: auto;
}

select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
    background-color: #fff;
    margin-bottom: 4px;
}

.tone-description {
    font-size: 0.9rem;
    color: #666;
    margin: -2px 0 0 0;
    font-style: italic;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 8px;
}

.temperature-tooltip {
    font-size: 0.9rem;
    color: #666;
    margin: 5px 0 0 0;
    font-style: italic;
    line-height: 1.4;
}

.example-icon {
    cursor: pointer;
    font-size: 0.9rem;
    color: #888;
    transition: color 0.2s ease;
    font-style: normal;
}

.example-icon:hover {
    color: var(--primary-color);
}

.example-box {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #333;
}

.hidden {
    display: none !important;
}

/* Ensure clipboard toast is hidden when it has the hidden class */
.clipboard-toast.hidden {
    display: none !important;
}

/* Generate button */
.generate-button {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background-color 0.3s;
}

.generate-button:hover {
    background-color: var(--primary-dark);
}

/* Secondary button */
.secondary-button {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background-color 0.3s, color 0.3s;
}

.secondary-button:hover {
    background-color: #ffe6f2; /* rosa muy claro */
}

.small-button {
    padding: 6px 10px;
    font-size: 0.9rem;
    width: auto;
    margin-left: 8px;
}

/* Loading indicator */
.loading-indicator {
    text-align: center;
    margin: 20px 0;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none;
}

/* Banner AdMob fijo abajo */
#admob-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px; /* altura estimada del banner */
    background-color: #f9f9f9; /* color de fondo temporal */
    border-top: 1px solid #ccc;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #666;
}

/* Result container */
.result-container {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    min-height: 130px;
    transition: background-color 0.3s;
    position: relative; /* para posicionar el toast dentro */
}

.result-highlight {
    background-color: rgba(48, 213, 200, 0.2); /* Light version of highlight color */
}

/* Toast para copia automática dentro del resultado */
.copy-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #333;
    color: #fff;
    padding: 15px 25px;
    border-radius: 10px;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    max-width: 90%;
    width: auto;
    text-align: center;
    font-size: 1.1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.copy-toast.show {
    opacity: 1;
    pointer-events: auto;
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.action-button {
    flex: 1;
    padding: 12px; /* Slightly larger for better touch targets */
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.action-button:hover {
    background-color: #008c59; /* Darker shade of verde jade */
}

/* Button animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.button-pulse {
    animation: pulse 0.3s ease-in-out;
}

/* Star button animation */
@keyframes star-pulse {
    0% { transform: scale(1); color: var(--primary-color); }
    50% { transform: scale(1.3); color: gold; }
    100% { transform: scale(1); }
}

#favoriteStar i.fas {
    color: gold;
}

#favoriteStar:hover i {
    transform: scale(1.1);
}

#favoriteStar.button-pulse i {
    animation: star-pulse 0.3s ease-in-out;
}

/* Character counter */
.char-counter {
    text-align: right;
    font-size: 0.85rem;
    color: #777;
}

.char-counter.warning {
    color: var(--accent-color);
}

.char-counter.error {
    color: #d9534f;
}

/* Collapsible section */
.collapsible-container {
    border-bottom: 1px solid #eee;
    margin: 10px 0;
}

.collapsible-trigger {
    width: 100%;
    background-color: var(--light-bg);
    color: var(--text-color);
    padding: 12px 15px;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible-trigger:hover {
    background-color: #f0f0f0;
    color: var(--primary-color);
}

.collapsible-trigger i {
    transition: transform 0.3s;
}

.collapsible-trigger.active i {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: white;
    padding: 0 15px;
}

.collapsible-content.active {
    max-height: 300px;
    padding: 15px;
}

.relationship-container, .original-message-container {
    margin-bottom: 15px;
}

.relationship-container label, .original-message-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    line-height: 1.4;
}

input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

/* Social share */
.social-share {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.share-button {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    background-color: var(--primary-color);
    transition: background-color 0.3s;
}

.share-button:hover {
    background-color: var(--primary-dark);
}

.social-buttons i {
    margin-right: 5px;
}

/* Ad banners */
.ad-banner {
    background-color: #f9f9f9;
    text-align: center;
    padding: 10px;
    color: #777;
    border-bottom: 1px solid #eee;
}

.container > .ad-banner:last-child {
    border-top: 1px solid #eee;
    border-bottom: none;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
}

/* Gender toggle styles */
.gender-toggle {
    position: relative;
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.result-container {
    position: relative;
}

/* Género: ahora fuera de la caja de respuesta */
.gender-toggle {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    align-items: center;
    margin-top: 2px;
    margin-bottom: 0;
    position: static;
}

.gender-icon {
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    color: #30D5C8; /* aqua por defecto */
    background: none;
    border: none;
    outline: none;
    padding: 0 2px;
}

.gender-icon[data-gender="femenino"] {
    color: #E4007C; /* rosa mexicano */
}

.gender-icon.active {
    opacity: 1;
    font-weight: bold;
    color: var(--primary-color);
}

/* Colores para íconos de género */
.gender-icon[data-gender="masculino"] {
    color: #30D5C8; /* aqua */
}

.gender-icon[data-gender="femenino"] {
    color: #E4007C; /* rosa mexicano */
}

.gender-icon.active {
    opacity: 1;
    font-weight: bold;
    color: var(--primary-color);
}

.gender-tooltip {
    font-size: 0.7rem;
    color: #888;
    margin-top: 2px;
    margin-bottom: 15px;
    margin-left: 10px;
    text-align: left;
}

/* Toast notification */
.clipboard-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 90%;
    width: auto;
    text-align: center;
    animation: fadeInOut 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.clipboard-toast-message {
    font-size: 0.95rem;
    margin-bottom: 5px;
    word-break: break-word;
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clipboard-toast-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.clipboard-toast-button {
    padding: 8px 15px;
    border-radius: 4px;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.clipboard-toast-button.accept {
    background-color: var(--secondary-color);
    color: white;
}

.clipboard-toast-button.accept:hover {
    background-color: #008c59;
}

.clipboard-toast-button.reject {
    background-color: #f1f1f1;
    color: #333;
}

.clipboard-toast-button.reject:hover {
    background-color: #e0e0e0;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -20px); }
    100% { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.clipboard-toast.hiding {
    animation: fadeOut 0.3s forwards;
}

/* Estilos para la fila de género */
.gender-row {
  display: flex;
  align-items: center;
  gap: 8px; /* Espacio entre íconos y texto */
  margin-top: -18px; /* Pegar más a la caja de respuesta */
  margin-bottom: 15px; /* Espacio antes de botones */
  padding-left: 2px; /* Pequeño margen izquierdo */
}

.gender-toggle {
    display: flex;
    gap: 0px; /* Reducir espacio entre íconos */
    margin: 0;
    position: static;
}

.gender-tooltip {
    font-size: 0.7rem;
    color: #888;
    margin: 0 0 0 4px; /* Reducir margen izquierdo */
    text-align: left;
    white-space: nowrap;
}

/* Mover específicamente el toast del clipboard más abajo */
#clipboardToast {
    top: 80px; /* Ajusta este valor según sea necesario */
}
