/* ============================================
   COMPONENTS.CSS - FlowTrading Global
   Botones, Cards, Modales, Formularios
============================================ */

/* ============================================
   BOTONES
============================================ */

/* Botón Primario */
.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--bg-dark);
    padding: 1rem 2.5rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--font-size-lg);
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
    outline: none;
    box-shadow: none;
    text-align: center;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold-lg);
}

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

/* Botón Secundario */
.btn-secondary {
    display: inline-block;
    background: transparent;
    color: var(--text-light);
    padding: 1rem 2.5rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--font-size-lg);
    border: 2px solid var(--gold);
    transition: all var(--transition-normal);
    cursor: pointer;
    outline: none;
    box-shadow: none;
    text-align: center;
}

body.light-mode .btn-secondary {
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: rgba(212, 175, 55, 0.1);
    transform: translateY(-3px);
}

/* Botón Outline */
.btn-outline {
    display: inline-block;
    background: transparent;
    color: var(--gold);
    padding: 0.8rem 2rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--font-size-base);
    border: 2px solid var(--gold);
    transition: all var(--transition-normal);
    cursor: pointer;
    text-align: center;
}

.btn-outline:hover {
    background: var(--gold);
    color: var(--bg-dark);
}

/* Botón Pequeño */
.btn-sm {
    padding: 0.6rem 1.5rem;
    font-size: var(--font-size-sm);
}

/* Botón Grande */
.btn-lg {
    padding: 1.2rem 3rem;
    font-size: var(--font-size-xl);
}

/* Botón Full Width */
.btn-full {
    width: 100%;
}

/* Botón Disabled */
.btn-disabled,
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   CARDS
============================================ */

/* Card Base */
.card {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), rgba(0, 0, 0, 0.8));
    border: 2px solid var(--border-gold);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    transition: all var(--transition-normal);
}

body.light-mode .card {
    background: var(--bg-dark);
    border-color: var(--gold);
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--border-gold-active);
    box-shadow: var(--shadow-gold);
}

/* Card con línea superior */
.card-accent {
    position: relative;
    overflow: hidden;
}

.card-accent::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.card-accent:hover::before {
    transform: scaleX(1);
}

/* Card Header */
.card-header {
    margin-bottom: var(--spacing-lg);
}

/* Card Body */
.card-body {
    margin-bottom: var(--spacing-lg);
}

/* Card Footer */
.card-footer {
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-gold);
}

/* ============================================
   PRODUCT CARD
============================================ */
.product-card {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), rgba(0, 0, 0, 0.8));
    border: 2px solid var(--border-gold);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

body.light-mode .product-card {
    background: var(--bg-dark);
    border-color: var(--gold);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.product-card:hover::before {
    transform: scaleX(1);
}

.product-card:hover {
    transform: translateY(-10px);
    border-color: var(--border-gold-active);
    box-shadow: 0 20px 60px rgba(212, 175, 55, 0.2);
}

body.light-mode .product-card:hover {
    border-color: var(--gold-light);
}

.product-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--spacing-lg);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-icon svg {
    width: 100%;
    height: 100%;
}

.product-card h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-md);
    color: var(--gold);
}

.product-card p {
    color: var(--text-light-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
}

body.light-mode .product-card p {
    color: var(--text-light);
}

.product-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: var(--spacing-lg);
}

.product-card .btn-primary {
    width: 100%;
    padding: 0.9rem;
    font-size: var(--font-size-base);
}

/* ============================================
   STAT CARD
============================================ */
.stat-card {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), rgba(0, 0, 0, 0.5));
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-gold);
    text-align: center;
    transition: transform var(--transition-normal);
}

body.light-mode .stat-card {
    background: var(--bg-dark);
    border-color: var(--gold);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-gold-active);
}

body.light-mode .stat-card:hover {
    border-color: var(--gold-light);
}

.stat-number {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    color: var(--gold);
    margin-bottom: var(--spacing-sm);
}

.stat-label {
    color: var(--text-light-secondary);
    font-size: var(--font-size-base);
}

body.light-mode .stat-label {
    color: var(--text-light);
}

/* ============================================
   FEATURE ITEM
============================================ */
.feature-item {
    text-align: center;
    padding: var(--spacing-xl);
}

.feature-icon {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-md);
}

.feature-item h4 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    color: var(--gold);
}

.feature-item p {
    color: var(--text-light-secondary);
    line-height: 1.6;
}

body.light-mode .feature-item p {
    color: var(--text-dark-secondary);
}

/* ============================================
   SEARCH MODAL
============================================ */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: var(--z-modal);
    padding: var(--spacing-xl);
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.search-modal.active {
    display: flex !important;
}

.search-container {
    width: 100%;
    max-width: 500px;
    background: var(--bg-dark-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 2px solid var(--gold);
    position: relative;
}

body.light-mode .search-container {
    background: var(--bg-light);
}

.search-input-wrapper {
    position: relative;
    margin-bottom: var(--spacing-md);
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 4rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: var(--font-size-lg);
    outline: none;
}

body.light-mode .search-input {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-dark);
    border-color: rgba(212, 175, 55, 0.5);
}

.search-input:focus {
    border-color: var(--gold);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

body.light-mode .search-input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.search-icon {
    position: absolute;
    left: 1.3rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--gold);
    pointer-events: none;
    z-index: 1;
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 1rem;
    -webkit-overflow-scrolling: touch;
}

.search-result-item {
    padding: 1rem;
    background: rgba(212, 175, 55, 0.08);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 1px solid rgba(212, 175, 55, 0.2);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.search-result-item:hover,
.search-result-item:active {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold);
}

.search-result-title {
    color: var(--gold);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.search-result-desc {
    color: var(--text-light-secondary);
    font-size: var(--font-size-sm);
}

body.light-mode .search-result-desc {
    color: var(--text-dark-secondary);
}

/* Search highlight - texto coincidente en resultados */
.search-highlight {
    color: var(--gold);
    font-weight: bold;
}

.close-search {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--gold);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    color: var(--gold);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

body.light-mode .close-search {
    background: rgba(255, 255, 255, 0.9);
    color: var(--gold);
}

.close-search:hover {
    background: var(--gold);
    color: #000;
    transform: scale(1.1);
}

/* Search Modal - Responsive */
@media (max-width: 768px) {
    .search-modal {
        padding: 15px;
        padding-top: 80px;
    }

    .search-container {
        max-width: 100%;
        padding: var(--spacing-md);
    }

    .search-input {
        font-size: var(--font-size-base);
        padding: 0.8rem 0.8rem 0.8rem 3rem;
    }

    .search-icon {
        left: 1rem;
        font-size: 1rem;
    }

    .search-results {
        max-height: 50vh;
    }

    .search-result-item {
        padding: 1rem;
    }

    .close-search {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .search-modal {
        padding: 12px;
        padding-top: 70px;
    }

    .search-container {
        padding: var(--spacing-sm);
        border-radius: var(--radius-md);
    }

    .search-input {
        font-size: 16px; /* Mínimo 16px para evitar zoom en iOS */
        padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    }

    .search-icon {
        left: 0.8rem;
        font-size: 0.9rem;
    }

    .search-results {
        max-height: 45vh;
    }

    .search-result-item {
        padding: 0.8rem;
    }

    .search-result-title {
        font-size: 0.9rem;
    }

    .search-result-desc {
        font-size: 0.8rem;
    }

    .close-search {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }
}

/* ============================================
   FORMULARIOS
============================================ */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    color: var(--text-light);
    font-size: var(--font-size-sm);
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
}

body.light-mode .form-group label {
    color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-gold);
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: var(--font-size-base);
    transition: all var(--transition-normal);
}

body.light-mode .form-group input,
body.light-mode .form-group textarea,
body.light-mode .form-group select {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-dark);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.05);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light-muted);
}

body.light-mode .form-group input::placeholder,
body.light-mode .form-group textarea::placeholder {
    color: var(--text-dark-muted);
}

/* Form Row (2 columnas) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-light-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
}

body.light-mode .checkbox-label {
    color: var(--text-dark-secondary);
}

.checkbox-label input[type='checkbox'] {
    width: 18px;
    height: 18px;
    accent-color: var(--gold);
    cursor: pointer;
}

/* ============================================
   BADGES
============================================ */
.badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.badge-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--bg-dark);
}

.badge-success {
    background: var(--success);
    color: var(--text-light);
}

.badge-warning {
    background: var(--warning);
    color: var(--bg-dark);
}

.badge-error {
    background: var(--error);
    color: var(--text-light);
}

.badge-outline {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
}

/* ============================================
   PROGRESS BAR
============================================ */
.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
}

body.light-mode .progress-bar {
    background: rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.progress-text {
    color: var(--text-light-secondary);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-sm);
}

body.light-mode .progress-text {
    color: var(--text-dark-secondary);
}

/* ============================================
   ALERTS / MESSAGES
============================================ */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.alert-success {
    background: rgba(37, 211, 102, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-warning {
    background: rgba(255, 165, 2, 0.1);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.alert-error {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-info {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--gold);
    color: var(--gold);
}

/* ============================================
   DIVIDERS
============================================ */
.divider {
    height: 1px;
    background: var(--border-gold);
    margin: var(--spacing-xl) 0;
}

.divider-text {
    display: flex;
    align-items: center;
    color: var(--text-light-muted);
    font-size: var(--font-size-sm);
    margin: var(--spacing-xl) 0;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-gold);
}

.divider-text span {
    padding: 0 var(--spacing-md);
}

/* ============================================
   TOOLTIPS
============================================ */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-dark-secondary);
    border: 1px solid var(--gold);
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: var(--font-size-xs);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: var(--z-tooltip);
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    margin-bottom: var(--spacing-sm);
}

/* ============================================
   LOADING SPINNER
============================================ */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-gold);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

/* ============================================
   SKELETON LOADER (Como la app)
============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--card) 25%, var(--card-light) 50%, var(--card) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

body.light-mode .skeleton {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
}

.skeleton-text-sm {
    height: 12px;
    width: 60%;
}

.skeleton-title {
    height: 24px;
    width: 80%;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-image {
    width: 100%;
    height: 180px;
    border-radius: var(--radius-md);
}

.skeleton-button {
    height: 44px;
    width: 120px;
    border-radius: var(--radius-md);
}

.skeleton-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border);
}

body.light-mode .skeleton-card {
    background: var(--card);
    border-color: var(--border);
}

/* ============================================
   STATUS INDICATORS (Como la app)
============================================ */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.active {
    background: var(--success);
    animation: statusPulse 2s ease-in-out infinite;
}

.status-dot.inactive {
    background: var(--status-inactive);
}

.status-dot.pending {
    background: var(--warning);
    animation: statusPulse 1.5s ease-in-out infinite;
}

.status-dot.error {
    background: var(--error);
}

@keyframes statusPulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.status-badge.active {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success);
}

.status-badge.inactive {
    background: rgba(102, 102, 102, 0.15);
    color: var(--status-inactive);
}

.status-badge.pending {
    background: rgba(255, 152, 0, 0.15);
    color: var(--warning);
}

.status-badge.error {
    background: rgba(244, 67, 54, 0.15);
    color: var(--error);
}

/* ============================================
   CARD THUMBNAIL (Como la app - CourseCard)
============================================ */
.card-thumbnail {
    background: var(--card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all var(--transition-normal);
}

body.light-mode .card-thumbnail {
    background: var(--card);
    border-color: var(--border);
}

.card-thumbnail:hover {
    transform: translateY(-4px);
    border-color: var(--border-gold);
    box-shadow: var(--shadow-card);
}

.card-thumbnail-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--card-light);
}

.card-thumbnail-body {
    padding: var(--spacing-md);
}

.card-thumbnail-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: var(--spacing-xs);
    line-height: 1.3;
}

body.light-mode .card-thumbnail-title {
    color: var(--text-dark);
}

.card-thumbnail-desc {
    font-size: var(--font-size-sm);
    color: var(--text-light-secondary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-thumbnail-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: var(--font-size-xs);
    color: var(--text-light-muted);
}

.card-thumbnail-meta i {
    color: var(--gold);
}

/* ============================================
   CARD PROGRESS (Curso en progreso)
============================================ */
.card-progress {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border);
    transition: all var(--transition-normal);
}

.card-progress:hover {
    border-color: var(--border-gold);
    box-shadow: var(--shadow-card);
}

.card-progress-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.card-progress-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-dark);
    font-size: 1.2rem;
}

.card-progress-info {
    flex: 1;
}

.card-progress-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 2px;
}

body.light-mode .card-progress-title {
    color: var(--text-dark);
}

.card-progress-subtitle {
    font-size: var(--font-size-xs);
    color: var(--text-light-muted);
}

.card-progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--spacing-xs);
}

.card-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.card-progress-label {
    font-size: var(--font-size-xs);
    color: var(--gold);
    text-align: right;
}

/* ============================================
   CARD QUICK ACCESS (Como HomeScreen de la app)
============================================ */
.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

@media (min-width: 768px) {
    .quick-access-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.card-quick-access {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    border: 1px solid var(--border);
    transition: all var(--transition-normal);
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.card-quick-access:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
}

.card-quick-access-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--spacing-md);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.05));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--gold);
}

.card-quick-access-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-light);
}

body.light-mode .card-quick-access-label {
    color: var(--text-dark);
}

/* ============================================
   BADGES ESPECIALES (Como la app)
============================================ */
.badge-free {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(76, 175, 80, 0.15);
    color: var(--success);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.badge-premium {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--bg-dark);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.badge-duration {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light-secondary);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
}

body.light-mode .badge-duration {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-dark-secondary);
}

.badge-new {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background: rgba(33, 150, 243, 0.15);
    color: var(--info);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
}

/* Badges posicionados en cards */
.card-badges {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    display: flex;
    gap: var(--spacing-xs);
    z-index: 10;
}

/* ============================================
   EMPTY STATES (Como la app)
============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    text-align: center;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--text-light-muted);
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

.empty-state-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
}

body.light-mode .empty-state-title {
    color: var(--text-dark);
}

.empty-state-text {
    font-size: var(--font-size-base);
    color: var(--text-light-secondary);
    max-width: 300px;
    margin-bottom: var(--spacing-xl);
}

.empty-state-cta {
    margin-top: var(--spacing-md);
}

/* ============================================
   FILTER TABS (Como la app)
============================================ */
.filter-tabs {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--card);
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar {
    display: none;
}

body.light-mode .filter-tabs {
    background: var(--card);
    border-color: var(--border);
}

.filter-tab {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-light-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-tab:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}

body.light-mode .filter-tab:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-dark);
}

.filter-tab.active {
    background: var(--gold);
    color: var(--bg-dark);
}

/* ============================================
   SWITCH TOGGLE (Como la app)
============================================ */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

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

.switch-track {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border);
    transition: all var(--transition-fast);
    border-radius: var(--radius-full);
}

.switch-track::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: var(--text-light);
    transition: all var(--transition-fast);
    border-radius: 50%;
}

body.light-mode .switch-track::before {
    background: #fff;
}

.switch input:checked + .switch-track {
    background: var(--gold);
}

.switch input:checked + .switch-track::before {
    transform: translateX(22px);
    background: var(--bg-dark);
}

.switch input:focus + .switch-track {
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.3);
}

/* Switch con label */
.switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}

.switch-label-text {
    font-size: var(--font-size-base);
    color: var(--text-light);
}

body.light-mode .switch-label-text {
    color: var(--text-dark);
}

.switch-label-desc {
    font-size: var(--font-size-sm);
    color: var(--text-light-muted);
    margin-top: 2px;
}

/* ============================================
   MENU ITEM (Como la app - ProfileScreen)
============================================ */
.menu-section {
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
}

.menu-section-title {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-light-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--text-light);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

body.light-mode .menu-item {
    color: var(--text-dark);
}

body.light-mode .menu-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.menu-item-icon {
    width: 40px;
    height: 40px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    margin-right: var(--spacing-md);
    font-size: 1.1rem;
}

.menu-item-content {
    flex: 1;
}

.menu-item-label {
    font-size: var(--font-size-base);
    font-weight: 500;
}

.menu-item-desc {
    font-size: var(--font-size-xs);
    color: var(--text-light-muted);
    margin-top: 2px;
}

.menu-item-arrow {
    color: var(--text-light-muted);
    font-size: 0.9rem;
}

.menu-item.danger {
    color: var(--error);
}

.menu-item.danger .menu-item-icon {
    background: rgba(244, 67, 54, 0.1);
    color: var(--error);
}

/* ============================================
   PROFILE HEADER (Como la app)
============================================ */
.profile-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-xl);
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: var(--spacing-lg);
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--bg-dark);
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 4px;
}

body.light-mode .profile-name {
    color: var(--text-dark);
}

.profile-email {
    font-size: var(--font-size-sm);
    color: var(--text-light-muted);
    margin-bottom: var(--spacing-sm);
}

.profile-plan {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--bg-dark);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
}

/* ============================================
   SUBSCRIPTION CARD (Como la app)
============================================ */
.subscription-card {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.05));
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.subscription-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.subscription-card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gold);
}

.subscription-card-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.subscription-card-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.subscription-card-plan {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-light);
}

body.light-mode .subscription-card-plan {
    color: var(--text-dark);
}

.subscription-card-details {
    text-align: right;
}

.subscription-card-label {
    font-size: var(--font-size-xs);
    color: var(--text-light-muted);
}

.subscription-card-value {
    font-size: var(--font-size-base);
    color: var(--text-light);
}

body.light-mode .subscription-card-value {
    color: var(--text-dark);
}

/* ============================================
   GREETING SECTION (Como HomeScreen de la app)
============================================ */
.greeting-section {
    margin-bottom: var(--spacing-xl);
}

.greeting-text {
    font-size: var(--font-size-sm);
    color: var(--text-light-secondary);
    margin-bottom: 4px;
}

.greeting-name {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-light);
}

body.light-mode .greeting-name {
    color: var(--text-dark);
}

.greeting-name .highlight {
    color: var(--gold);
}

/* ============================================
   SECTION HEADER (Como la app)
============================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.section-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-light);
}

body.light-mode .section-title {
    color: var(--text-dark);
}

.section-link {
    font-size: var(--font-size-sm);
    color: var(--gold);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all var(--transition-fast);
}

.section-link:hover {
    color: var(--gold-light);
}

/* ============================================
   BOT STATUS CARD (Como la app)
============================================ */
.bot-status-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border);
    margin-bottom: var(--spacing-lg);
}

.bot-status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.bot-status-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

body.light-mode .bot-status-title {
    color: var(--text-dark);
}

.bot-status-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    text-align: center;
}

.bot-metric {
    padding: var(--spacing-sm);
}

.bot-metric-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--gold);
}

.bot-metric-label {
    font-size: var(--font-size-xs);
    color: var(--text-light-muted);
    margin-top: 4px;
}

/* ============================================
   USER MENU (Header Dropdown)
   Movido desde main.js para mejor organizacion
============================================ */
.user-menu-container {
    position: relative;
    display: flex;
    align-items: center;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 25px;
    transition: all var(--transition-normal);
}

.user-menu-trigger:hover {
    background: rgba(212, 175, 55, 0.1);
}

/* .user-avatar-header movido a CSS/components/avatar.css */

.user-name-header {
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.light-mode .user-name-header {
    color: var(--text-dark);
}

.user-menu-trigger .dropdown-arrow {
    color: var(--text-light-muted);
    font-size: 0.7rem;
    transition: transform var(--transition-normal);
}

.user-menu-container.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-dark-secondary);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    min-width: 280px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    z-index: var(--z-dropdown);
    overflow: hidden;
}

body.light-mode .user-dropdown {
    background: var(--bg-light);
    border-color: var(--gold);
}

.user-menu-container.active .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
    background: rgba(212, 175, 55, 0.05);
}

.user-avatar-large {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-dark);
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.user-info-dropdown {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
}

.user-fullname {
    color: var(--text-light);
    font-weight: 600;
    font-size: 1rem;
}

body.light-mode .user-fullname {
    color: var(--text-dark);
}

.user-email-dropdown {
    color: var(--text-light-muted);
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem 1.2rem;
    color: var(--text-light-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 0.95rem;
    background: transparent;
    border: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
}

body.light-mode .user-dropdown-item {
    color: var(--text-dark-secondary);
}

.user-dropdown-item:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold);
}

.user-dropdown-item.logout-item {
    color: var(--error);
}

.user-dropdown-item.logout-item:hover {
    background: rgba(244, 67, 54, 0.1);
}

@media (max-width: 768px) {
    .user-name-header {
        display: none;
    }
}

@media (max-width: 480px) {
    .user-dropdown {
        min-width: min(280px, calc(100vw - 2rem));
        right: -10px;
    }

    .user-dropdown-header {
        padding: 1rem;
    }

    .user-avatar-large {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .user-dropdown-item {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   FLOATING WHATSAPP BUTTON
============================================ */
.floating-whatsapp {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all var(--transition-normal);
    z-index: 1500;
    text-decoration: none;
}

.floating-whatsapp:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.5);
}

.floating-whatsapp svg {
    width: 32px;
    height: 32px;
    fill: #fff;
    color: #fff;
}

@media (max-width: 768px) {
    .floating-whatsapp {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }

    .floating-whatsapp svg {
        width: 28px;
        height: 28px;
    }
}

/* ============================================
   CHATBOT WIDGET
   Reemplaza el boton de WhatsApp
============================================ */
.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1500;
    font-family: inherit;
}

/* Toggle - Robot sin fondo */
.chatbot-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    position: relative;
    padding: 0;
    outline: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.chatbot-toggle:hover {
    transform: translateY(-8px);
}

.chatbot-toggle:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
    border-radius: 8px;
}

/* Robot SVG */
.chatbot-bot {
    overflow: visible;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

.chatbot-toggle:hover .chatbot-bot {
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35));
}

/* Boton cerrar cuando esta abierto */
.chatbot-close-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.chatbot-close-icon svg {
    fill: #fff;
    width: 20px;
    height: 20px;
}

/* Cuando esta abierto: ocultar robot, mostrar X */
.chatbot-container.open .chatbot-bot {
    opacity: 0;
    transform: scale(0.5);
    visibility: hidden;
    animation: none;
}

.chatbot-container.open .chatbot-close-icon {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.chatbot-container.open .chatbot-close-icon:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 115px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 180px);
    background: var(--bg-secondary, #1a1a1a);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    border: 1px solid rgba(212, 175, 55, 0.2);
    touch-action: pan-y;
}

.chatbot-container.open .chatbot-window {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

body.light-mode .chatbot-window {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
}

/* Header */
.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: #fff;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-avatar svg {
    fill: #fff;
}

.chatbot-title {
    display: flex;
    flex-direction: column;
}

.chatbot-name {
    font-weight: 600;
    font-size: 1rem;
}

.chatbot-status {
    font-size: 0.75rem;
    opacity: 0.9;
}

.chatbot-minimize {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    touch-action: manipulation;
}

.chatbot-minimize:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chatbot-minimize svg {
    fill: #fff;
}

/* Messages Container */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-primary, #0a0a0a);
}

body.light-mode .chatbot-messages {
    background: #f5f5f5;
}

/* Message Bubbles */
.chatbot-message {
    max-width: 85%;
    animation: chatMessageFadeIn 0.3s ease;
}

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

.chatbot-message.user {
    align-self: flex-end;
}

.chatbot-message.assistant {
    align-self: flex-start;
}

.chatbot-message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.chatbot-message.user .chatbot-message-content {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chatbot-message.assistant .chatbot-message-content {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-light, #e0e0e0);
    border-bottom-left-radius: 4px;
}

body.light-mode .chatbot-message.assistant .chatbot-message-content {
    background: #fff;
    color: var(--text-dark, #1a1a1a);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Typing Indicator */
.chatbot-typing {
    align-self: flex-start;
    padding: 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

body.light-mode .chatbot-typing {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chatbot-typing-dots {
    display: flex;
    gap: 4px;
}

.chatbot-typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    animation: chatTypingBounce 1.4s ease-in-out infinite;
}

.chatbot-typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.chatbot-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes chatTypingBounce {
    0%,
    60%,
    100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-6px);
    }
}

/* Quick Actions */
.chatbot-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-secondary, #1a1a1a);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode .chatbot-quick-actions {
    background: #fff;
    border-top-color: rgba(0, 0, 0, 0.1);
}

.chatbot-quick-btn {
    padding: 8px 14px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    color: var(--gold);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    touch-action: manipulation;
}

.chatbot-quick-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold);
}

/* Input Container */
.chatbot-input-container {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: var(--bg-secondary, #1a1a1a);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode .chatbot-input-container {
    background: #fff;
    border-top-color: rgba(0, 0, 0, 0.1);
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    color: var(--text-light, #e0e0e0);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

body.light-mode .chatbot-input {
    background: #f5f5f5;
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-dark, #1a1a1a);
}

.chatbot-input:focus {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.05);
}

.chatbot-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

body.light-mode .chatbot-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.chatbot-send {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    touch-action: manipulation;
}

.chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.chatbot-send svg {
    fill: #fff;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: 25px;
        right: 25px;
    }

    .chatbot-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 140px);
        max-height: 550px;
        right: 0;
        bottom: 100px;
    }

    .chatbot-quick-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .chatbot-close-icon {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        bottom: 20px;
        right: 20px;
    }

    .chatbot-window {
        position: absolute;
        bottom: 85px;
        right: 0;
        width: calc(100vw - 20px);
        max-width: 340px;
        height: auto;
        max-height: 60vh;
        min-height: 350px;
        border-radius: 16px;
        transform: translateY(20px) scale(0.95);
    }

    .chatbot-container.open .chatbot-window {
        transform: translateY(0) scale(1);
    }

    .chatbot-header {
        padding: 12px 16px;
    }

    .chatbot-messages {
        padding: 12px;
        max-height: calc(60vh - 180px);
        min-height: 120px;
    }

    .chatbot-message-content {
        font-size: 0.85rem;
        padding: 10px 14px;
    }

    /* Prevenir zoom en iOS al hacer focus en input */
    .chatbot-input {
        font-size: 16px;
        touch-action: manipulation;
    }

    .chatbot-quick-actions {
        padding: 10px 12px;
    }

    .chatbot-input-container {
        padding: 12px;
    }
}

/* ============================================
   CHATBOT BOT ANIMADO
   Estados: idle, waving, sleeping, active
============================================ */

/* Transiciones suaves para partes del robot */
.chatbot-bot .bot-head,
.chatbot-bot .bot-body,
.chatbot-bot .bot-eyes,
.chatbot-bot .bot-eyes-sleeping,
.chatbot-bot .bot-arm-left,
.chatbot-bot .bot-arm-right,
.chatbot-bot .bot-antenna-stem,
.chatbot-bot .bot-antenna-ball {
    transition: all 0.3s ease;
}

/* Floating animation - suave */
@keyframes botFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

.chatbot-container:not(.open) .chatbot-bot {
    animation: botFloat 3s ease-in-out infinite;
}

/* Blinking animation - ojos cyan */
@keyframes botBlink {
    0%,
    45%,
    55%,
    100% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(0.1);
    }
}

.chatbot-bot .bot-eyes {
    transform-origin: center 34px;
    animation: botBlink 4s ease-in-out infinite;
}

/* Antenna glow pulse - cyan */
@keyframes antennaGlow {
    0%,
    100% {
        filter: drop-shadow(0 0 3px rgba(78, 205, 196, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(78, 205, 196, 1));
    }
}

.chatbot-bot .bot-antenna-ball {
    animation: antennaGlow 2s ease-in-out infinite;
}

/* Eye glow pulse */
@keyframes eyeGlow {
    0%,
    100% {
        filter: url(#eyeGlowFilter) drop-shadow(0 0 2px rgba(78, 205, 196, 0.3));
    }
    50% {
        filter: url(#eyeGlowFilter) drop-shadow(0 0 6px rgba(78, 205, 196, 0.6));
    }
}

.chatbot-bot .bot-eyes {
    animation:
        botBlink 4s ease-in-out infinite,
        eyeGlow 3s ease-in-out infinite;
}

/* Estado inicial de los brazos (CRÍTICO para animación fluida) */
.bot-arm-left {
    transform: rotate(15deg);
    transform-origin: 13px 60px;
}

.bot-arm-right {
    transform: rotate(-15deg);
    transform-origin: 67px 60px;
}

/* Waving animation - brazo derecho */
@keyframes botWave {
    /* Inicio */
    0% {
        transform: rotate(-15deg);
    }

    /* Subida fluida */
    5% {
        transform: rotate(-45deg);
    }
    10% {
        transform: rotate(-80deg);
    }
    15% {
        transform: rotate(-120deg);
    }
    20% {
        transform: rotate(-140deg);
    }

    /* Saludos arriba - 3 oscilaciones */
    25% {
        transform: rotate(-120deg);
    }
    30% {
        transform: rotate(-145deg);
    }
    35% {
        transform: rotate(-120deg);
    }
    40% {
        transform: rotate(-145deg);
    }
    45% {
        transform: rotate(-120deg);
    }
    50% {
        transform: rotate(-140deg);
    }

    /* Bajada fluida - misma velocidad que subida */
    55% {
        transform: rotate(-120deg);
    }
    60% {
        transform: rotate(-95deg);
    }
    65% {
        transform: rotate(-70deg);
    }
    70% {
        transform: rotate(-50deg);
    }
    75% {
        transform: rotate(-35deg);
    }
    80% {
        transform: rotate(-25deg);
    }
    85% {
        transform: rotate(-20deg);
    }
    90% {
        transform: rotate(-17deg);
    }
    100% {
        transform: rotate(-15deg);
    }
}

.chatbot-container.waving .bot-arm-right {
    animation: botWave 2s ease-in-out 1;
}

/* Speech bubble - globo de mensaje */
.chatbot-speech-bubble {
    position: absolute;
    bottom: 70px;
    right: 75px;
    background: #ffffff;
    color: #1a1a2e;
    padding: 8px 18px;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    pointer-events: none;
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
    z-index: 9998;
}

/* Modo día - globo negro con texto blanco */
body.light-mode .chatbot-speech-bubble {
    background: #1a1a2e;
    color: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.chatbot-speech-bubble.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Ocultar speech bubble cuando el chat está abierto */
.chatbot-container.open .chatbot-speech-bubble {
    display: none;
}

/* Responsive speech bubble */
@media (max-width: 480px) {
    .chatbot-speech-bubble {
        bottom: 70px;
        right: 70px;
        font-size: 12px;
        padding: 6px 14px;
    }
}

/* Sleeping state */
.chatbot-container.sleeping .bot-eyes {
    opacity: 0;
    animation: none;
}

.chatbot-container.sleeping .bot-eyes-sleeping {
    opacity: 1 !important;
}

@keyframes zzzFloat {
    0%,
    100% {
        opacity: 0.4;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-6px);
    }
}

.chatbot-container.sleeping .bot-zzz {
    opacity: 1 !important;
}

.chatbot-container.sleeping .bot-zzz text:nth-child(1) {
    animation: zzzFloat 2s ease-in-out infinite 0s;
}

.chatbot-container.sleeping .bot-zzz text:nth-child(2) {
    animation: zzzFloat 2s ease-in-out infinite 0.3s;
}

.chatbot-container.sleeping .bot-zzz text:nth-child(3) {
    animation: zzzFloat 2s ease-in-out infinite 0.6s;
}

/* Sleeping bot slower float */
.chatbot-container.sleeping .chatbot-bot {
    animation: botFloat 5s ease-in-out infinite;
}

/* Sleeping - antenna dimmed */
.chatbot-container.sleeping .bot-antenna-ball {
    animation: none;
    filter: drop-shadow(0 0 2px rgba(78, 205, 196, 0.3));
}

/* Hover effect - excited */
.chatbot-toggle:hover .bot-antenna-ball {
    animation: antennaGlow 0.3s ease-in-out infinite;
}

.chatbot-toggle:hover .bot-eyes {
    animation: eyeGlow 0.5s ease-in-out infinite;
    transform: scaleY(1.05);
}

/* Hover - slight body bounce */
@keyframes botExcited {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-2px) scale(1.02);
    }
}

.chatbot-toggle:hover .bot-main {
    animation: botExcited 0.5s ease-in-out infinite;
}

/* Wake up transition from sleeping */
.chatbot-container.waking .bot-eyes-sleeping {
    opacity: 0 !important;
    transition: opacity 0.3s ease;
}

.chatbot-container.waking .bot-eyes {
    opacity: 1;
    animation: none;
}

.chatbot-container.waking .bot-zzz {
    opacity: 0 !important;
    transition: opacity 0.3s ease;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .chatbot-bot {
        width: 60px;
        height: 82px;
    }
}

@media (max-width: 480px) {
    .chatbot-bot {
        width: 55px;
        height: 75px;
    }
}

/* .default-avatar-icon movido a CSS/components/avatar.css */

/* ============================================
   PHONE INPUT WITH COUNTRY CODE
   Componente reutilizable para teléfono
============================================ */
.phone-input-container {
    display: flex;
    gap: 8px;
}

.phone-country-code {
    flex-shrink: 0;
    width: 110px;
}

.phone-country-code select {
    width: 100%;
    height: 100%;
    padding: 0.9rem 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-gold);
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all var(--transition-normal);
}

body.light-mode .phone-country-code select {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-dark);
}

.phone-country-code select:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.05);
}

.phone-number-input {
    flex: 1;
}

.phone-number-input input {
    width: 100%;
}

@media (max-width: 480px) {
    .phone-input-container {
        flex-direction: row;
    }

    .phone-country-code {
        width: 100px;
    }
}
