/* ===============================================
   ESTILOS DE MI CUENTA
   Página de perfil del usuario con estadísticas
   =============================================== */

/* Contenedor del dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Botón principal (usuario + ícono) */
.account-dropdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s;
}

/* Ícono (flecha) */
.account-dropdown svg {
    transition: transform 0.3s;
}

.dropdown:hover .account-dropdown svg {
    transform: rotate(180deg);
}

/* Menú desplegable */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(100, 56, 194, 0.2);
    min-width: 180px;
    z-index: 1000;
    margin-top: 4px;
    padding: 8px;
    list-style: none;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    display: block;
}

/* Asegurar que el área entre el botón y el menú no cierre el dropdown */
.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 8px;
}

/* Estilo de enlaces dentro del menú */
.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    color: var(--txt-color);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    border-radius: 8px;
}

.dropdown-menu a:hover {
    background: rgba(193, 174, 233, 0.1);
    color: var(--hover-color);
    transform: translateX(4px);
}

/* Username recortado si es muy largo */
#account-username {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===============================================
   PÁGINA DE MI CUENTA
   =============================================== */

.account-main {
    max-width: 1400px;
    margin: 0px auto 2rem;
    padding: 0 2rem 2rem;
    position: relative;
    z-index: 1;
}

.account-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.account-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--txt-color);
    margin: 0 0 0.5rem 0;
    text-shadow: 0 2px 10px rgba(193, 174, 233, 0.3);
}

.account-subtitle {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin: 0;
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* ===============================================
   SECCIONES DE CUENTA
   =============================================== */

.account-section {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.account-section:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(100, 56, 194, 0.2);
    border-color: var(--hover-color);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(193, 174, 233, 0.2);
}

.section-header svg {
    color: var(--txt-color);
    flex-shrink: 0;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--txt-color);
    margin: 0;
}

/* ===============================================
   ESTADÍSTICAS DE USO
   =============================================== */

.usage-stats {
    grid-column: 1 / -1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(193, 174, 233, 0.05);
    border: 2px solid rgba(193, 174, 233, 0.15);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--hover-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(193, 174, 233, 0.15);
}

.stat-card.premium {
    background: linear-gradient(135deg, rgba(193, 174, 233, 0.1), rgba(100, 56, 194, 0.1));
    border-color: var(--txt-color);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.premium-icon {
    background: linear-gradient(135deg, rgb(193, 174, 233), rgb(100, 56, 194));
}

.attempts-icon {
    background: rgba(74, 107, 255, 0.2);
}

.reset-icon {
    background: rgba(0, 212, 255, 0.2);
}

.stat-icon svg {
    color: white;
}

.stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--txt-color);
}

/* Badges y estados */
.premium-badge {
    background: linear-gradient(135deg, rgb(193, 174, 233), rgb(100, 56, 194));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.unlimited {
    color: rgb(193, 174, 233);
    font-weight: 600;
}

.attempts-count {
    font-weight: 700;
}

.attempts-count.high {
    color: #4CAF50;
}

.attempts-count.medium {
    color: #FFA726;
}

.attempts-count.low {
    color: #EF5350;
}

.reset-today {
    color: rgb(193, 174, 233);
    font-weight: 600;
}

/* ===============================================
   BANNER DE ACTUALIZACIÓN
   =============================================== */

.upgrade-banner {
    background: linear-gradient(135deg, rgba(193, 174, 233, 0.1), rgba(100, 56, 194, 0.1));
    border: 2px solid var(--txt-color);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.banner-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgb(193, 174, 233), rgb(100, 56, 194));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: iconFloat 3s ease-in-out infinite;
}

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

.banner-icon svg {
    color: white;
}

.banner-text {
    flex: 1;
    min-width: 250px;
}

.banner-text h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--txt-color);
    margin: 0 0 0.5rem 0;
}

.banner-text p {
    font-size: 1rem;
    color: var(--secondary-color);
    margin: 0;
}

.banner-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, rgb(100, 56, 194), rgb(193, 174, 233));
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.banner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(100, 56, 194, 0.4);
}

.banner-btn svg {
    transition: transform 0.3s ease;
}

.banner-btn:hover svg {
    transform: translateX(4px);
}

/* ===============================================
   INFORMACIÓN DEL PERFIL
   =============================================== */

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(193, 174, 233, 0.05);
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.info-item:hover {
    background: rgba(193, 174, 233, 0.1);
    transform: translateX(4px);
}

.info-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: var(--secondary-color);
}

.info-label svg {
    color: var(--txt-color);
}

.info-value {
    font-weight: 600;
    color: var(--txt-color);
}

/* ===============================================
   SECCIÓN DE SEGURIDAD
   =============================================== */

.security-section {
    margin-bottom: 1.5rem;
}

.security-section:last-child {
    margin-bottom: 0;
}

.security-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--txt-color);
    margin: 0 0 1rem 0;
}

/* ===============================================
   ACCIONES Y BOTONES
   =============================================== */

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn-action {
    padding: 12px 24px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: transparent;
    color: var(--txt-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-action:hover {
    background: rgba(193, 174, 233, 0.1);
    border-color: var(--hover-color);
    transform: translateY(-2px);
}

.btn-change-password {
    border-color: rgb(74, 107, 255);
    color: rgb(74, 107, 255);
}

.btn-change-password:hover {
    background: rgba(74, 107, 255, 0.1);
    border-color: rgb(74, 107, 255);
}

/* ===============================================
   ACCIONES RÁPIDAS
   =============================================== */

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quick-action-btn {
    padding: 14px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: rgba(193, 174, 233, 0.05);
    color: var(--txt-color);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.quick-action-btn:hover {
    background: rgba(193, 174, 233, 0.1);
    border-color: var(--hover-color);
    transform: translateX(4px);
}

.quick-action-btn svg {
    flex-shrink: 0;
    color: var(--txt-color);
}

.logout-btn {
    border-color: #EF5350;
    color: #EF5350;
}

.logout-btn:hover {
    background: rgba(239, 83, 80, 0.1);
    border-color: #EF5350;
}

/* ===============================================
   RESPONSIVE
   =============================================== */

@media (max-width: 1200px) {
    .account-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .account-main {
        margin: 100px auto 1rem;
        padding: 0 1rem 1rem;
    }

    .account-header h1 {
        font-size: 2rem;
    }

    .account-subtitle {
        font-size: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .banner-content {
        flex-direction: column;
        text-align: center;
    }

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

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

.account-section {
    padding: 2rem;
    background: var(--account-bg);
    border-radius: 8px;
}

.info-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.info-label {
    display: block;
    font-weight: 600;
    color: var(--account-secondary);
    margin-bottom: 0.5rem;
}

.info-value {
    font-size: 1.1rem;
    color: var(--account-text);
}

.security-section {
    margin-top: 2rem;
    border-top: 2px solid var(--account-bg);
    padding-top: 2rem;
}

.account-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.btn-action {
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-change-password {
    background: var(--account-primary);
    color: white;
}

.btn-logout {
    background: #e63946;
    color: white;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.sessions-list {
    margin-top: 1rem;
}

.session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    margin-bottom: 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.current-session {
    border-left: 4px solid var(--account-primary);
}

@media (max-width: 768px) {
    .account-grid {
        grid-template-columns: 1fr;
    }
    
    .account-main {
        margin: 1rem;
        padding: 1rem;
    }
}

.profile-picture {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.5rem;
    display: block;
    border: 4px solid var(--account-primary);
}


.h2-account{
    color: var(--txt-color);
}

/* ===============================================
   ESTILOS DE SUSCRIPCIÓN PREMIUM
   =============================================== */

/* Banner de actualización */
.upgrade-banner {
    margin-top: 2rem;
    padding: 0;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(100, 56, 194, 0.1), rgba(139, 92, 246, 0.1));
    border: 2px solid var(--border-color);
    border-radius: 16px;
    flex-wrap: wrap;
}

.banner-icon svg {
    fill: var(--primary-color);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.banner-text {
    flex: 1;
    min-width: 200px;
}

.banner-text h3 {
    color: var(--txt-color);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.banner-text p {
    color: var(--txt-color-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.pricing-options {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.price-tag {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: rgba(100, 56, 194, 0.15);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.price-tag .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price-tag .period {
    font-size: 0.875rem;
    color: var(--txt-color-secondary);
}

.price-tag.price-yearly {
    position: relative;
}

.price-tag .savings {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.banner-btn {
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, #6438c2, #8b5cf6);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(100, 56, 194, 0.3);
    white-space: nowrap;
}

.banner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 56, 194, 0.4);
}

.banner-btn svg {
    fill: none;
}

/* Sección de gestión de suscripción */
.premium-section {
    background: linear-gradient(135deg, rgba(100, 56, 194, 0.05), rgba(139, 92, 246, 0.05));
    border: 2px solid rgba(100, 56, 194, 0.3);
}

.premium-header {
    color: var(--primary-color);
}

.subscription-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.subscription-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #6438c2, #8b5cf6);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    width: fit-content;
}

.subscription-badge svg {
    fill: none;
}

.subscription-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-item {
    padding: 1rem;
    background: var(--input-bg, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.detail-label {
    display: block;
    font-size: 0.875rem;
    color: var(--txt-color-secondary);
    margin-bottom: 0.5rem;
}

.detail-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--txt-color);
}

.subscription-actions {
    margin-top: 1rem;
}

.btn-danger {
    padding: 0.875rem 1.5rem;
    background: transparent;
    color: #ef4444;
    border: 2px solid #ef4444;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-danger svg {
    fill: none;
}

.cancel-note {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--txt-color-secondary);
}

/* Modal de Premium */
.premium-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.premium-modal-overlay.active {
    opacity: 1;
}

.premium-modal-content {
    background: var(--bg-color, rgba(26, 26, 46, 0.98));
    border: 2px solid var(--border-color);
    border-radius: 24px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.premium-modal-overlay.active .premium-modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--txt-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    z-index: 10;
}

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

.modal-close svg {
    fill: none;
}

.modal-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #6438c2, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon svg {
    fill: none;
    stroke: white;
}

.modal-header h2 {
    color: var(--txt-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.modal-header p {
    color: var(--txt-color-secondary);
    font-size: 1rem;
}

.pricing-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.pricing-plan {
    position: relative;
    padding: 2rem;
    background: var(--input-bg, rgba(255, 255, 255, 0.03));
    border: 2px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pricing-plan:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(100, 56, 194, 0.3);
}

.pricing-plan.featured {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(100, 56, 194, 0.1), rgba(139, 92, 246, 0.1));
}

.plan-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.plan-header {
    margin-bottom: 1.5rem;
}

.plan-header h3 {
    color: var(--txt-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.price-amount {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6438c2, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-period {
    font-size: 1rem;
    color: var(--txt-color-secondary);
}

.savings-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.plan-features li {
    padding: 0.75rem 0;
    color: var(--txt-color);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.plan-features li:last-child {
    border-bottom: none;
}

.plan-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #6438c2, #8b5cf6);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(100, 56, 194, 0.3);
}

.plan-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 56, 194, 0.4);
}

.modal-footer {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.modal-footer p {
    color: var(--txt-color-secondary);
    font-size: 0.875rem;
}

/* Animación de spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsivo para el modal */
@media (max-width: 768px) {
    .pricing-plans {
        grid-template-columns: 1fr;
    }
    
    .premium-modal-content {
        padding: 1.5rem;
    }
    
    .price-amount {
        font-size: 2.5rem;
    }
    
    .banner-content {
        flex-direction: column;
        text-align: center;
    }
    
    .banner-btn {
        width: 100%;
        justify-content: center;
    }
}
