/**
 * Association Membership Manager - Shortcodes Styles
 * CSS DEDICADO PARA SHORTCODES - Máxima Especificidade
 * Versão: 1.0.2
 */

/* ========================================
   SHORTCODE: BOTÃO DE FILIAÇÃO
   [amm_membership_button]
======================================== */

/* Wrapper Principal */
.woocommerce-MyAccount-content .amm-membership-button-wrapper,
.entry-content .amm-membership-button-wrapper,
.elementor-widget-container .amm-membership-button-wrapper,
body .amm-membership-button-wrapper {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 30px auto !important;
    padding: 30px !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-radius: 15px !important;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1) !important;
    text-align: center !important;
    clear: both !important;
    overflow: visible !important;
}

/* Botões - Estilo Base */
.woocommerce-MyAccount-content .amm-membership-button-wrapper .amm-button,
.entry-content .amm-membership-button-wrapper .amm-button,
.elementor-widget-container .amm-membership-button-wrapper .amm-button,
body .amm-membership-button-wrapper .amm-button,
.woocommerce-MyAccount-content a.amm-button,
.entry-content a.amm-button,
.elementor-widget-container a.amm-button,
body a.amm-button {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    padding: 18px 45px !important;
    margin: 0 auto !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    text-align: center !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    border: none !important;
    border-radius: 50px !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
    min-width: 280px !important;
    max-width: 400px !important;
    white-space: nowrap !important;
    z-index: 10 !important;
}

/* Botão Complete Profile (Vermelho - perfil incompleto) */
.woocommerce-MyAccount-content .amm-complete-profile,
.entry-content .amm-complete-profile,
.elementor-widget-container .amm-complete-profile,
body .amm-complete-profile,
.woocommerce-MyAccount-content a.amm-complete-profile,
.entry-content a.amm-complete-profile,
.elementor-widget-container a.amm-complete-profile,
body a.amm-complete-profile {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    color: #ffffff !important;
}

.woocommerce-MyAccount-content .amm-complete-profile:hover,
.entry-content .amm-complete-profile:hover,
.elementor-widget-container .amm-complete-profile:hover,
body .amm-complete-profile:hover,
.woocommerce-MyAccount-content a.amm-complete-profile:hover,
.entry-content a.amm-complete-profile:hover,
.elementor-widget-container a.amm-complete-profile:hover,
body a.amm-complete-profile:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%) !important;
    color: #ffffff !important;
    transform: translateY(-4px) scale(1.02) !important;
    box-shadow: 0 12px 30px rgba(231, 76, 60, 0.4) !important;
}

/* Botão Edit Profile (Verde - perfil completo) */
.woocommerce-MyAccount-content .amm-edit-profile,
.entry-content .amm-edit-profile,
.elementor-widget-container .amm-edit-profile,
body .amm-edit-profile,
.woocommerce-MyAccount-content a.amm-edit-profile,
.entry-content a.amm-edit-profile,
.elementor-widget-container a.amm-edit-profile,
body a.amm-edit-profile {
    background: linear-gradient(135deg, #169d53 0%, #128a46 100%) !important;
    color: #ffffff !important;
}

.woocommerce-MyAccount-content .amm-edit-profile:hover,
.entry-content .amm-edit-profile:hover,
.elementor-widget-container .amm-edit-profile:hover,
body .amm-edit-profile:hover,
.woocommerce-MyAccount-content a.amm-edit-profile:hover,
.entry-content a.amm-edit-profile:hover,
.elementor-widget-container a.amm-edit-profile:hover,
body a.amm-edit-profile:hover {
    background: linear-gradient(135deg, #128a46 0%, #0f7138 100%) !important;
    color: #ffffff !important;
    transform: translateY(-4px) scale(1.02) !important;
    box-shadow: 0 12px 30px rgba(22, 157, 83, 0.4) !important;
}

.woocommerce-MyAccount-content .amm-complete-profile:active,
.entry-content .amm-complete-profile:active,
.elementor-widget-container .amm-complete-profile:active,
body .amm-complete-profile:active {
    transform: translateY(-2px) scale(1.01) !important;
}

/* Botão Subscribe / Fazer Filiação */
.woocommerce-MyAccount-content .amm-subscribe,
.entry-content .amm-subscribe,
.elementor-widget-container .amm-subscribe,
body .amm-subscribe,
.woocommerce-MyAccount-content a.amm-subscribe,
.entry-content a.amm-subscribe,
.elementor-widget-container a.amm-subscribe,
body a.amm-subscribe {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
}

.woocommerce-MyAccount-content .amm-subscribe:hover,
.entry-content .amm-subscribe:hover,
.elementor-widget-container .amm-subscribe:hover,
body .amm-subscribe:hover,
.woocommerce-MyAccount-content a.amm-subscribe:hover,
.entry-content a.amm-subscribe:hover,
.elementor-widget-container a.amm-subscribe:hover,
body a.amm-subscribe:hover {
    background: linear-gradient(135deg, #764ba2 0%, #5a3780 100%) !important;
    color: #ffffff !important;
    transform: translateY(-4px) scale(1.02) !important;
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4) !important;
}

.woocommerce-MyAccount-content .amm-subscribe:active,
.entry-content .amm-subscribe:active,
.elementor-widget-container .amm-subscribe:active,
body .amm-subscribe:active {
    transform: translateY(-2px) scale(1.01) !important;
}

/* Icon Before Button */
.woocommerce-MyAccount-content .amm-complete-profile:before,
.entry-content .amm-complete-profile:before,
body .amm-complete-profile:before {
    content: "⚠" !important;
    display: inline-block !important;
    margin-right: 10px !important;
    font-size: 20px !important;
}

.woocommerce-MyAccount-content .amm-subscribe:before,
.entry-content .amm-subscribe:before,
body .amm-subscribe:before {
    content: "✓" !important;
    display: inline-block !important;
    margin-right: 10px !important;
    font-size: 20px !important;
}

/* ========================================
   SHORTCODE: STATUS DO PERFIL
   [amm_profile_status]
======================================== */

.woocommerce-MyAccount-content .amm-profile-status,
.entry-content .amm-profile-status,
.elementor-widget-container .amm-profile-status,
body .amm-profile-status {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 30px auto !important;
    padding: 30px !important;
    background: #ffffff !important;
    border: 2px solid #e8e8e8 !important;
    border-radius: 15px !important;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08) !important;
    clear: both !important;
}

.woocommerce-MyAccount-content .amm-profile-status h3,
.entry-content .amm-profile-status h3,
.elementor-widget-container .amm-profile-status h3,
body .amm-profile-status h3 {
    margin: 0 0 20px 0 !important;
    padding: 0 !important;
    color: #2c3e50 !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    text-align: center !important;
    line-height: 1.3 !important;
}

.woocommerce-MyAccount-content .amm-progress-bar,
.entry-content .amm-progress-bar,
.elementor-widget-container .amm-progress-bar,
body .amm-progress-bar {
    position: relative !important;
    width: 100% !important;
    height: 40px !important;
    background: #e9ecef !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    margin: 20px 0 !important;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1) !important;
}

.woocommerce-MyAccount-content .amm-progress-fill,
.entry-content .amm-progress-fill,
.elementor-widget-container .amm-progress-fill,
body .amm-progress-fill {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 20px !important;
    transition: width 1s ease-out !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    min-width: 50px !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
}

.woocommerce-MyAccount-content .amm-progress-text,
.entry-content .amm-progress-text,
.elementor-widget-container .amm-progress-text,
body .amm-progress-text {
    display: block !important;
    text-align: center !important;
    margin-top: 15px !important;
    color: #555 !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    line-height: 1.6 !important;
}

/* ========================================
   SHORTCODE: CAMPOS FALTANTES
   [amm_missing_fields]
======================================== */

.woocommerce-MyAccount-content .amm-missing-fields,
.entry-content .amm-missing-fields,
.elementor-widget-container .amm-missing-fields,
body .amm-missing-fields {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 30px auto !important;
    padding: 30px !important;
    background: #fff3cd !important;
    border: 3px solid #ffc107 !important;
    border-radius: 15px !important;
    box-shadow: 0 5px 20px rgba(255, 193, 7, 0.2) !important;
    clear: both !important;
}

.woocommerce-MyAccount-content .amm-missing-fields h3,
.entry-content .amm-missing-fields h3,
.elementor-widget-container .amm-missing-fields h3,
body .amm-missing-fields h3 {
    margin: 0 0 20px 0 !important;
    padding: 0 !important;
    color: #856404 !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
}

.woocommerce-MyAccount-content .amm-fields-list,
.entry-content .amm-fields-list,
.elementor-widget-container .amm-fields-list,
body .amm-fields-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce-MyAccount-content .amm-fields-list li,
.entry-content .amm-fields-list li,
.elementor-widget-container .amm-fields-list li,
body .amm-fields-list li {
    position: relative !important;
    padding: 12px 0 12px 35px !important;
    margin: 8px 0 !important;
    color: #856404 !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.6 !important;
    border-bottom: 1px solid rgba(255, 193, 7, 0.3) !important;
}

.woocommerce-MyAccount-content .amm-fields-list li:last-child,
.entry-content .amm-fields-list li:last-child,
.elementor-widget-container .amm-fields-list li:last-child,
body .amm-fields-list li:last-child {
    border-bottom: none !important;
}

.woocommerce-MyAccount-content .amm-fields-list li:before,
.entry-content .amm-fields-list li:before,
.elementor-widget-container .amm-fields-list li:before,
body .amm-fields-list li:before {
    content: "⚠" !important;
    position: absolute !important;
    left: 0 !important;
    top: 12px !important;
    color: #ffc107 !important;
    font-size: 20px !important;
    line-height: 1 !important;
}

/* Mensagem de Perfil Completo */
.woocommerce-MyAccount-content .amm-complete-message,
.entry-content .amm-complete-message,
.elementor-widget-container .amm-complete-message,
body .amm-complete-message {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 30px auto !important;
    padding: 30px !important;
    background: #d4edda !important;
    border: 3px solid #28a745 !important;
    border-radius: 15px !important;
    color: #155724 !important;
    text-align: center !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    line-height: 1.5 !important;
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.2) !important;
}

.woocommerce-MyAccount-content .amm-complete-message:before,
.entry-content .amm-complete-message:before,
.elementor-widget-container .amm-complete-message:before,
body .amm-complete-message:before {
    content: "✓" !important;
    display: inline-block !important;
    margin-right: 12px !important;
    font-size: 24px !important;
    color: #28a745 !important;
}

/* ========================================
   RESPONSIVE - MOBILE OPTIMIZATIONS
======================================== */

@media (max-width: 768px) {
    .woocommerce-MyAccount-content .amm-membership-button-wrapper,
    .entry-content .amm-membership-button-wrapper,
    body .amm-membership-button-wrapper {
        padding: 20px 15px !important;
        margin: 20px 0 !important;
    }
    
    .woocommerce-MyAccount-content .amm-button,
    .entry-content .amm-button,
    body .amm-button {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: auto !important;
        padding: 16px 25px !important;
        font-size: 15px !important;
        letter-spacing: 1px !important;
    }
    
    .woocommerce-MyAccount-content .amm-profile-status,
    .entry-content .amm-profile-status,
    body .amm-profile-status,
    .woocommerce-MyAccount-content .amm-missing-fields,
    .entry-content .amm-missing-fields,
    body .amm-missing-fields {
        padding: 20px 15px !important;
        margin: 20px 0 !important;
    }
    
    .woocommerce-MyAccount-content .amm-profile-status h3,
    .entry-content .amm-profile-status h3,
    body .amm-profile-status h3,
    .woocommerce-MyAccount-content .amm-missing-fields h3,
    .entry-content .amm-missing-fields h3,
    body .amm-missing-fields h3 {
        font-size: 18px !important;
    }
    
    .woocommerce-MyAccount-content .amm-progress-bar,
    .entry-content .amm-progress-bar,
    body .amm-progress-bar {
        height: 35px !important;
    }
    
    .woocommerce-MyAccount-content .amm-progress-fill,
    .entry-content .amm-progress-fill,
    body .amm-progress-fill {
        font-size: 14px !important;
    }
    
    .woocommerce-MyAccount-content .amm-fields-list li,
    .entry-content .amm-fields-list li,
    body .amm-fields-list li {
        font-size: 14px !important;
        padding: 10px 0 10px 30px !important;
    }
}

@media (max-width: 480px) {
    .woocommerce-MyAccount-content .amm-button,
    .entry-content .amm-button,
    body .amm-button {
        padding: 14px 20px !important;
        font-size: 14px !important;
    }
    
    .woocommerce-MyAccount-content .amm-complete-message,
    .entry-content .amm-complete-message,
    body .amm-complete-message {
        font-size: 16px !important;
        padding: 25px 20px !important;
    }
}

/* ========================================
   DARK MODE SUPPORT (Optional)
======================================== */

@media (prefers-color-scheme: dark) {
    body.dark-mode .amm-profile-status,
    body.dark-mode .amm-membership-button-wrapper {
        background: #2c3e50 !important;
        border-color: #34495e !important;
        color: #ecf0f1 !important;
    }
    
    body.dark-mode .amm-profile-status h3 {
        color: #ecf0f1 !important;
    }
    
    body.dark-mode .amm-progress-bar {
        background: #34495e !important;
    }
}

/* ========================================
   PRINT STYLES
======================================== */

@media print {
    .amm-membership-button-wrapper,
    .amm-button {
        display: none !important;
    }
    
    .amm-profile-status,
    .amm-missing-fields {
        border: 2px solid #000 !important;
        box-shadow: none !important;
    }
}

/* ========================================
   ASTRA THEME SPECIFIC OVERRIDES
======================================== */

.ast-container .amm-membership-button-wrapper,
.ast-container .amm-profile-status,
.ast-container .amm-missing-fields {
    max-width: 100% !important;
}

.ast-article-post .amm-membership-button-wrapper,
.ast-article-post .amm-profile-status,
.ast-article-post .amm-missing-fields {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Override Astra Button Styles */
.ast-button .amm-button,
.ast-theme-button .amm-button {
    all: unset !important;
}

.amm-button.ast-button,
.amm-button.ast-theme-button,
a.amm-button.ast-button,
a.amm-button.ast-theme-button {
    display: inline-block !important;
    visibility: visible !important;
    padding: 18px 45px !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border-radius: 50px !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
}

/* Ensure visibility in Elementor */
.elementor-widget-text-editor .amm-membership-button-wrapper,
.elementor-widget-text-editor .amm-profile-status,
.elementor-widget-text-editor .amm-missing-fields {
    display: block !important;
    visibility: visible !important;
}

/* WooCommerce My Account Page Specific */
.woocommerce-account .woocommerce-MyAccount-content .amm-membership-button-wrapper {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
}

.woocommerce-account .entry-content .amm-button {
    margin: 10px auto !important;
}
