/* ============================================
   SUSCRIPCION.CSS - FlowTrading Global
   Estilos IDENTICOS a la App Movil
============================================ */

/* ============================================
   MAIN CONTENT
============================================ */
.subscription-page {
    padding: 20px 16px;
    padding-top: 160px;
    padding-bottom: 40px;
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-dark);
    min-height: 100vh;
}

body.light-mode .subscription-page {
    background: var(--bg-light);
}

/* ============================================
   PAGE HEADER
============================================ */
.subscription-page-header {
    text-align: center;
    margin-bottom: 40px;
}

.subscription-page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-light);
    margin: 0 0 8px 0;
}

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

.subscription-page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

/* ============================================
   BILLING PERIOD SELECTOR
============================================ */
#periodSelector {
    margin-bottom: 32px;
}

.period-selector {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.period-btn {
    padding: 12px 20px;
    background: var(--bg-card, #1a1a1a);
    border: 2px solid var(--border-color, #333);
    border-radius: 12px;
    color: var(--text-muted, #888);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 100px;
}

.period-btn:hover {
    border-color: var(--primary, #d4af37);
    color: var(--text-light, #fff);
}

.period-btn.active {
    background: var(--primary, #d4af37);
    border-color: var(--primary, #d4af37);
    color: #000;
}

.period-discount {
    font-size: 11px;
    font-weight: 700;
    color: #4caf50;
    background: rgba(76, 175, 80, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
}

.period-btn.active .period-discount {
    background: rgba(0, 0, 0, 0.2);
    color: #000;
}

body.light-mode .period-btn {
    background: #f5f5f5;
    border-color: #ddd;
    color: #666;
}

body.light-mode .period-btn:hover {
    border-color: var(--primary, #d4af37);
    color: #333;
}

body.light-mode .period-btn.active {
    background: var(--primary, #d4af37);
    color: #000;
}

.period-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted, #888);
    margin-top: 12px;
    margin-bottom: 0;
}

/* ============================================
   PLAN CARDS - Grid responsive
   Desktop: 3 columnas (2 filas) | Tablet: 2 columnas | Movil: 1 columna
   Orden: Gratis, Libro, Bot (fila 1) | Pro, Premium, Elite (fila 2)
============================================ */
.plans-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 280px));
    gap: 20px;
    align-items: stretch;
    justify-content: center;
}

.plan-card {
    border-radius: 16px;
    padding: 28px;
    border-width: 3px;
    border-style: solid;
    position: relative;
    overflow: hidden;
    min-height: 420px;
    display: flex;
    flex-direction: column;
}

.plan-features {
    flex: 1;
}

.plan-btn {
    margin-top: auto;
}

body.light-mode .plan-card {
    background: #ffffff;
}

/* Plan colors - borderColor: plan.color, backgroundColor: current ? card : plan.color + '35' */
.plan-card.plan-free {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.21);
}

.plan-card.plan-pro {
    border-color: #d8d8d8;
    background: rgba(216, 216, 216, 0.21);
}

.plan-card.plan-premium {
    border-color: #d4a017;
    background: rgba(212, 160, 23, 0.21);
}

.plan-card.plan-libro {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

.plan-card.plan-bot {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.21);
}

.plan-card.plan-elite {
    border-color: #9b59b6;
    background: rgba(155, 89, 182, 0.21);
}

.plan-card.plan-maestro {
    border-color: #c9a227;
    background: rgba(201, 162, 39, 0.21);
}

/* Current plan - fondo card solido */
.plan-card.current {
    background: #1a1a1a;
}

body.light-mode .plan-card.current {
    background: #f8f8f8;
}

/* Disabled plan (lower than current) */
.plan-card.disabled {
    opacity: 0.6;
}

/* ============================================
   PLAN BADGE - position: absolute, top: 0, right: 0, borderBottomLeftRadius: 8
============================================ */
.plan-badge {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-bottom-left-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #000;
    text-transform: uppercase;
}

.plan-badge ion-icon {
    font-size: 14px;
}

.plan-free .plan-badge {
    background: #27ae60;
}

.plan-libro .plan-badge {
    background: #ffffff;
    color: #1a1a1a;
}

.plan-bot .plan-badge {
    background: #3498db;
}

.plan-pro .plan-badge {
    background: #d8d8d8;
}

.plan-premium .plan-badge {
    background: #d4a017;
}

.plan-elite .plan-badge {
    background: #9b59b6;
}

.plan-maestro .plan-badge {
    background: #c9a227;
}

/* ============================================
   PLAN INFO - planName: fontSize: 20, planPrice: fontSize: 36
============================================ */
.plan-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-light);
    margin: 0 0 8px 0;
}

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

.plan-price-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 16px;
}

/* Precio del COLOR DEL PLAN - fontSize: 36 */
.plan-price {
    font-size: 36px;
    font-weight: 800;
}

.plan-free .plan-price {
    color: #27ae60;
}
.plan-libro .plan-price {
    color: #ffffff;
}
.plan-bot .plan-price {
    color: #3498db;
}
.plan-pro .plan-price {
    color: #d8d8d8;
}
.plan-premium .plan-price {
    color: #d4a017;
}
.plan-elite .plan-price {
    color: #9b59b6;
}
.plan-maestro .plan-price {
    color: #c9a227;
}

.plan-period {
    font-size: 16px;
    color: var(--text-muted);
    margin-left: 4px;
}

/* Plan price info (total and savings) */
.plan-price-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.plan-total {
    font-size: 13px;
    color: var(--text-muted);
}

.plan-savings {
    font-size: 12px;
    font-weight: 700;
    color: #4caf50;
    background: rgba(76, 175, 80, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ============================================
   PLAN FEATURES - marginVertical: 6, gap: 10
============================================ */
.plan-features {
    margin-bottom: 20px;
}

.plan-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0;
}

/* Check icons del COLOR DEL PLAN */
.plan-feature ion-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.plan-free .plan-feature ion-icon {
    color: #27ae60;
}
.plan-libro .plan-feature ion-icon {
    color: #ffffff;
}
.plan-bot .plan-feature ion-icon {
    color: #3498db;
}
.plan-pro .plan-feature ion-icon {
    color: #d8d8d8;
}
.plan-premium .plan-feature ion-icon {
    color: #d4a017;
}
.plan-elite .plan-feature ion-icon {
    color: #9b59b6;
}
.plan-maestro .plan-feature ion-icon {
    color: #c9a227;
}

.plan-feature-text {
    font-size: 14px;
    color: var(--text-light);
    flex: 1;
}

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

/* Excluded features (strikethrough) */
.plan-feature.excluded ion-icon {
    color: #666 !important;
}

.plan-feature.excluded .plan-feature-text {
    color: #666;
    text-decoration: line-through;
    opacity: 0.6;
}

body.light-mode .plan-feature.excluded .plan-feature-text {
    color: #999;
}

/* Included features (highlighted) */
.plan-feature.included .plan-feature-text {
    color: var(--text-light);
}

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

/* ============================================
   PLAN BUTTON - backgroundColor: plan.color, color: #fff
============================================ */
.plan-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: block;
}

/* Boton del COLOR DEL PLAN */
.plan-free .plan-btn {
    background: #27ae60;
}
.plan-libro .plan-btn {
    background: #ffffff;
    color: #1a1a1a;
}
.plan-bot .plan-btn {
    background: #3498db;
}
.plan-pro .plan-btn {
    background: #d8d8d8;
    color: #1a1a1a;
}
.plan-premium .plan-btn {
    background: #d4a017;
}
.plan-elite .plan-btn {
    background: #9b59b6;
}
.plan-maestro .plan-btn {
    background: #c9a227;
}

.plan-btn:hover:not(:disabled) {
    opacity: 0.9;
}

/* Boton deshabilitado (Plan Actual o incluido) */
.plan-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ============================================
   MAESTRO DESIGN (ADMIN)
============================================ */
.maestro-container {
    padding: 24px;
    text-align: center;
    padding-top: 40px;
    max-width: 500px;
    margin: 0 auto;
}

.maestro-icon-wrapper {
    width: 140px;
    height: 140px;
    border-radius: 70px;
    background: #0d0d0d;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px auto;
    border: 3px solid #c9a227;
    box-shadow: 0 0 30px rgba(201, 162, 39, 0.5);
}

.maestro-icon-inner {
    width: 110px;
    height: 110px;
    border-radius: 55px;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(201, 162, 39, 0.25);
}

.maestro-icon-inner svg {
    width: 55px;
    height: 55px;
    fill: #c9a227;
}

.maestro-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-light);
    margin: 0 0 8px 0;
    letter-spacing: 2px;
}

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

.maestro-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0d0d0d;
    padding: 10px 20px;
    border-radius: 25px;
    margin-bottom: 24px;
    border: 1px solid #c9a227;
}

.maestro-badge svg {
    width: 18px;
    height: 18px;
    fill: #c9a227;
}

.maestro-badge-text {
    color: #c9a227;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
}

.maestro-description {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 32px;
}

.maestro-features-card {
    background: #0d0d0d;
    padding: 24px;
    border-radius: 20px;
    text-align: left;
    border: 1px solid rgba(201, 162, 39, 0.2);
    margin-bottom: 32px;
}

.maestro-features-title {
    color: #c9a227;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 20px 0;
    letter-spacing: 1px;
}

.maestro-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.maestro-feature:last-child {
    margin-bottom: 0;
}

.maestro-feature-icon {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    background: rgba(201, 162, 39, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.maestro-feature-icon svg {
    width: 14px;
    height: 14px;
    fill: #c9a227;
}

.maestro-feature-text {
    color: #fff;
    font-size: 15px;
}

.maestro-back-btn {
    display: inline-block;
    background: #0d0d0d;
    padding: 16px 40px;
    border-radius: 30px;
    border: 2px solid #c9a227;
    color: #c9a227;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 1px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.maestro-back-btn:hover {
    background: #c9a227;
    color: #000;
}

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

/* Tablet grande - 3 columnas se mantiene */
@media (max-width: 1200px) {
    .plans-container {
        gap: 16px;
    }

    .plan-card {
        padding: 24px;
    }
}

/* Tablet - 2 columnas */
@media (max-width: 900px) {
    .plans-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet pequeña / Móvil grande */
@media (max-width: 768px) {
    .subscription-page {
        max-width: min(500px, 100% - 2rem);
        padding: 20px 16px;
        padding-top: 140px;
    }

    .subscription-page-header {
        margin-bottom: 24px;
    }

    .subscription-page-title {
        font-size: 24px;
    }

    .period-selector {
        gap: 6px;
        flex-wrap: nowrap;
        justify-content: center;
        width: 100%;
    }

    .period-btn {
        padding: 8px 10px;
        min-width: 0;
        flex: 1;
        max-width: 85px;
        font-size: 12px;
    }

    .period-discount {
        font-size: 9px;
        padding: 2px 4px;
    }

    #periodSelector {
        margin-bottom: 24px;
    }

    .plans-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .plan-card {
        min-height: auto;
        padding: 20px;
    }

    .plan-price {
        font-size: 32px;
    }

    .maestro-container {
        max-width: min(500px, 100% - 2rem);
        padding: 20px 16px;
    }

    .maestro-title {
        font-size: 26px;
    }
}

/* Móvil pequeño */
@media (max-width: 480px) {
    .subscription-page {
        padding: 16px 12px;
        padding-top: 150px;
    }

    .subscription-page-title {
        font-size: 22px;
    }

    .plan-card {
        padding: 16px;
    }

    .plan-name {
        font-size: 18px;
    }

    .plan-price {
        font-size: 28px;
    }

    .maestro-container {
        padding: 16px 12px;
    }

    .maestro-title {
        font-size: 22px;
    }

    .maestro-icon-wrapper {
        width: 100px;
        height: 100px;
    }

    .maestro-icon-inner {
        width: 80px;
        height: 80px;
    }
}

/* ============================================
   LOADING & ERROR STATES
============================================ */
.plans-loading,
.plans-error {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.plans-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.plans-loading p,
.plans-error p {
    margin: 0 0 16px 0;
    font-size: 14px;
}

.plans-error ion-icon {
    font-size: 48px;
    color: var(--danger);
    margin-bottom: 16px;
}

.plans-error .btn-secondary {
    padding: 10px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.plans-error .btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

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

/* ============================================
   COMING SOON OVERLAY
============================================ */
.coming-soon-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.6) 0%, rgba(26, 26, 26, 0.6) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.coming-soon-overlay.hidden {
    display: none;
}

.coming-soon-content {
    text-align: center;
    max-width: 500px;
}

.coming-soon-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    background: linear-gradient(135deg, var(--gold, #d4af37), #b8962e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-glow 2s ease-in-out infinite;
}

.coming-soon-icon ion-icon {
    font-size: 60px;
    color: #000;
}

@keyframes pulse-glow {
    0%,
    100% {
        box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 60px rgba(212, 175, 55, 0.6);
        transform: scale(1.05);
    }
}

.coming-soon-content h1 {
    font-size: 48px;
    font-weight: 700;
    color: var(--gold, #d4af37);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.coming-soon-content > p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 40px;
}

.coming-soon-features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.coming-soon-features .feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.coming-soon-features .feature-item ion-icon {
    font-size: 32px;
    color: var(--gold, #d4af37);
}

.coming-soon-features .feature-item span {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: transparent;
    border: 2px solid var(--gold, #d4af37);
    border-radius: 50px;
    color: var(--gold, #d4af37);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-back-home:hover {
    background: var(--gold, #d4af37);
    color: #000;
    transform: translateY(-2px);
}

.btn-back-home ion-icon {
    font-size: 18px;
}

/* Light mode overlay */
body.light-mode .coming-soon-overlay {
    background: linear-gradient(135deg, rgba(245, 245, 245, 0.9) 0%, rgba(255, 255, 255, 0.9) 100%);
}

body.light-mode .coming-soon-content > p {
    color: #666666;
}

body.light-mode .coming-soon-features .feature-item span {
    color: #888888;
}

@media (max-width: 480px) {
    .coming-soon-icon {
        width: 100px;
        height: 100px;
    }

    .coming-soon-icon ion-icon {
        font-size: 50px;
    }

    .coming-soon-content h1 {
        font-size: 32px;
        letter-spacing: 2px;
    }

    .coming-soon-content > p {
        font-size: 14px;
    }

    .coming-soon-features {
        gap: 20px;
    }

    .coming-soon-features .feature-item ion-icon {
        font-size: 28px;
    }
}
