/* ============================================
   WP Magazine Manager - Estilos Profesionales
   Layout Optimizado
   ============================================ */

/* Variables CSS */
:root {
    --wpmm-primary: #2563eb;
    --wpmm-primary-dark: #1d4ed8;
    --wpmm-secondary: #64748b;
    --wpmm-success: #10b981;
    --wpmm-whatsapp: #25d366;
    --wpmm-paypal: #0070ba;
    --wpmm-bg: #f8fafc;
    --wpmm-card: #ffffff;
    --wpmm-text: #1e293b;
    --wpmm-text-light: #64748b;
    --wpmm-border: #e2e8f0;
    --wpmm-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --wpmm-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --wpmm-radius: 12px;
    --wpmm-radius-sm: 8px;
    --wpmm-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Contenedor principal */
.wpmm-magazine-container {
    max-width: 1100px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--wpmm-text);
}

/* ============================================
   GRID PRINCIPAL - 2 COLUMNAS
   ============================================ */
.wpmm-main-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    background: linear-gradient(135deg, var(--wpmm-card) 0%, var(--wpmm-bg) 100%);
    border-radius: var(--wpmm-radius);
    box-shadow: var(--wpmm-shadow-lg);
    padding: 35px;
    border: 1px solid var(--wpmm-border);
    margin-bottom: 30px;
}

/* ============================================
   COLUMNA IZQUIERDA
   ============================================ */
.wpmm-left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Portada */
.wpmm-cover-section {
    position: relative;
}

.wpmm-cover-wrapper {
    position: relative;
    border-radius: var(--wpmm-radius);
    overflow: hidden;
    box-shadow: var(--wpmm-shadow-lg);
    transition: var(--wpmm-transition);
}

.wpmm-cover-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.wpmm-cover-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 3/4;
    object-fit: cover;
}

.wpmm-cover-badge {
    position: absolute;
    top: 12px;
    right: 12px;
}

.wpmm-badge-edition {
    display: inline-block;
    background: var(--wpmm-primary);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* Placeholder */
.wpmm-cover-placeholder {
    width: 100%;
    aspect-ratio: 3/4;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-radius: var(--wpmm-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--wpmm-secondary);
    gap: 12px;
}

/* Info rápida debajo de la portada */
.wpmm-quick-info {
    background: var(--wpmm-bg);
    border-radius: var(--wpmm-radius-sm);
    padding: 16px;
    border: 1px solid var(--wpmm-border);
}

.wpmm-quick-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--wpmm-text-light);
    font-size: 13px;
    margin-bottom: 8px;
}

.wpmm-quick-item:last-child {
    margin-bottom: 0;
}

.wpmm-quick-item svg {
    color: var(--wpmm-primary);
    flex-shrink: 0;
}

/* Botones sociales sidebar */
.wpmm-social-sidebar {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: var(--wpmm-radius-sm);
    padding: 20px;
    border: 1px solid var(--wpmm-border);
    margin-top: auto;
}

.wpmm-social-sidebar h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--wpmm-text-light);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wpmm-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wpmm-social-buttons .wpmm-btn,
.wpmm-social-buttons .wpmm-paypal-button {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 14px;
}

/* ============================================
   COLUMNA DERECHA
   ============================================ */
.wpmm-right-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header */
.wpmm-info-header {
    border-bottom: 2px solid var(--wpmm-border);
    padding-bottom: 20px;
}

.wpmm-category {
    display: inline-block;
    background: linear-gradient(135deg, var(--wpmm-primary) 0%, var(--wpmm-primary-dark) 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.wpmm-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--wpmm-text);
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.wpmm-description {
    font-size: 16px;
    color: var(--wpmm-text-light);
    line-height: 1.7;
    margin: 0;
}

.wpmm-description p {
    margin: 0;
}

/* Selector de idioma */
.wpmm-language-section {
    background: var(--wpmm-bg);
    padding: 20px;
    border-radius: var(--wpmm-radius-sm);
    border: 1px solid var(--wpmm-border);
}

.wpmm-language-section label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--wpmm-text);
    margin-bottom: 12px;
    font-size: 14px;
}

.wpmm-language-section label svg {
    color: var(--wpmm-primary);
}

.wpmm-lang-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wpmm-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--wpmm-card);
    border: 2px solid var(--wpmm-border);
    border-radius: var(--wpmm-radius-sm);
    cursor: pointer;
    transition: var(--wpmm-transition);
    font-size: 14px;
    color: var(--wpmm-text);
}

.wpmm-lang-btn:hover {
    border-color: var(--wpmm-primary);
    background: rgba(37, 99, 235, 0.05);
}

.wpmm-lang-btn.active,
.wpmm-lang-btn.active:hover {
    background: var(--wpmm-primary) !important;
    border-color: var(--wpmm-primary) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.wpmm-lang-flag {
    font-size: 16px;
}

.wpmm-lang-name {
    font-weight: 500;
}

/* ============================================
   BOTONES DE ACCIÓN PRINCIPALES
   ============================================ */
.wpmm-main-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    margin-top: auto;
}

.wpmm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border-radius: var(--wpmm-radius-sm);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--wpmm-transition);
    border: none;
    cursor: pointer;
    line-height: 1.4;
}

.wpmm-btn svg {
    flex-shrink: 0;
}

/* Botón primario - Descargar */
.wpmm-btn-primary {
    background: linear-gradient(135deg, var(--wpmm-success) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.wpmm-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    color: white;
}

.wpmm-btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.3;
}

.wpmm-btn-label {
    font-size: 16px;
    font-weight: 700;
}

.wpmm-btn-sublabel {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 400;
}

/* Botón secundario - Ver online */
.wpmm-btn-secondary {
    background: var(--wpmm-card);
    color: var(--wpmm-primary);
    border: 2px solid var(--wpmm-primary);
    padding: 16px 20px;
    white-space: nowrap;
}

.wpmm-btn-secondary:hover {
    background: var(--wpmm-primary);
    color: white;
}

/* Botón WhatsApp */
.wpmm-btn-whatsapp {
    background: var(--wpmm-whatsapp);
    color: white;
}

.wpmm-btn-whatsapp:hover {
    background: #128c7e;
    color: white;
}

/* Botón PayPal */
.wpmm-paypal-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    background: var(--wpmm-paypal);
    color: white;
    border: none;
    border-radius: var(--wpmm-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--wpmm-transition);
    text-decoration: none;
}

.wpmm-paypal-button:hover {
    background: #003087;
    color: white;
}

/* ============================================
   CARACTERÍSTICAS
   ============================================ */
.wpmm-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 30px;
}

.wpmm-feature {
    background: var(--wpmm-card);
    padding: 30px 24px;
    border-radius: var(--wpmm-radius);
    text-align: center;
    border: 1px solid var(--wpmm-border);
    transition: var(--wpmm-transition);
}

.wpmm-feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--wpmm-shadow-lg);
    border-color: var(--wpmm-primary);
}

.wpmm-feature-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--wpmm-primary) 0%, var(--wpmm-primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
}

.wpmm-feature h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--wpmm-text);
    margin: 0 0 8px 0;
}

.wpmm-feature p {
    font-size: 14px;
    color: var(--wpmm-text-light);
    margin: 0;
    line-height: 1.6;
}

/* ============================================
   NOTIFICACIONES
   ============================================ */
.wpmm-notice {
    padding: 12px 20px;
    border-radius: var(--wpmm-radius-sm);
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 500;
    animation: wpmm-slide-down 0.3s ease-out;
}

.wpmm-notice-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.wpmm-notice-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

@keyframes wpmm-slide-down {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   ALERTA NO PDF
   ============================================ */
.wpmm-no-pdf-alert {
    background: #fef3c7;
    border: 2px solid #fbbf24;
    border-radius: var(--wpmm-radius);
    padding: 40px;
    text-align: center;
    margin-top: 30px;
}

.wpmm-no-pdf-alert svg {
    color: #f59e0b;
    margin-bottom: 16px;
}

.wpmm-no-pdf-alert h3 {
    font-size: 20px;
    font-weight: 700;
    color: #92400e;
    margin: 0 0 8px 0;
}

.wpmm-no-pdf-alert p {
    font-size: 15px;
    color: #a16207;
    margin: 0;
}

/* ============================================
   LOADING
   ============================================ */
.wpmm-loading-state {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.wpmm-loading-state::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: wpmm-spin 0.8s linear infinite;
    margin-left: 8px;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media screen and (max-width: 900px) {
    .wpmm-main-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 25px;
    }

    .wpmm-left-column {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
    }

    .wpmm-cover-section {
        max-width: 280px;
        flex-shrink: 0;
    }

    .wpmm-quick-info {
        flex: 1;
        min-width: 200px;
    }

    .wpmm-social-sidebar {
        width: 100%;
        margin-top: 0;
    }

    .wpmm-social-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .wpmm-social-buttons .wpmm-btn,
    .wpmm-social-buttons .wpmm-paypal-button {
        width: auto;
        flex: 1;
        min-width: 150px;
    }

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

    .wpmm-main-actions {
        grid-template-columns: 1fr;
    }

    .wpmm-features {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 600px) {
    .wpmm-main-grid {
        padding: 20px;
    }

    .wpmm-left-column {
        flex-direction: column;
    }

    .wpmm-cover-section {
        max-width: 100%;
        margin: 0 auto;
    }

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

    .wpmm-btn {
        width: 100%;
    }

    .wpmm-lang-options {
        justify-content: center;
    }

    .wpmm-lang-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }

    .wpmm-social-buttons .wpmm-btn,
    .wpmm-social-buttons .wpmm-paypal-button {
        width: 100%;
    }

    .wpmm-feature {
        padding: 24px 20px;
    }
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes wpmm-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wpmm-magazine-container {
    animation: wpmm-fade-in 0.6s ease-out;
}

.wpmm-feature:nth-child(1) { animation: wpmm-fade-in 0.6s ease-out 0.1s both; }
.wpmm-feature:nth-child(2) { animation: wpmm-fade-in 0.6s ease-out 0.2s both; }
.wpmm-feature:nth-child(3) { animation: wpmm-fade-in 0.6s ease-out 0.3s both; }
