/**
 * Estilos Frontend - ABVCAP Glue Up Integration
 */

/* ==========================================================================
   Conteúdo Restrito
   ========================================================================== */

.abvcap-restricted-content {
    position: relative;
    margin: 20px 0;
}

.abvcap-content-preview {
    position: relative;
    opacity: 0.7;
    margin-bottom: -30px;
    z-index: 1;
}

.abvcap-fade-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.9), white);
    pointer-events: none;
}

.abvcap-access-barrier {
    position: relative;
    z-index: 2;
    background: #112468;
    border: 2px solid #fff;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(17, 36, 104, 0.3);
    margin-top: 20px;
}

.abvcap-lock-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.abvcap-restriction-info {
    margin-bottom: 30px;
}

.abvcap-title {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.abvcap-description {
    color: #fff;
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 15px 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.abvcap-membership-requirements {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #fff;
    border-radius: 6px;
    padding: 10px 15px;
    margin: 15px auto 0;
    max-width: 400px;
}

.abvcap-membership-requirements small {
    color: #fff;
    font-weight: 500;
}

/* ==========================================================================
   Formulário de Login
   ========================================================================== */

.abvcap-login-form {
    max-width: 400px;
    margin: 0 auto;
    background: #112468;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid #fff;
}

.abvcap-form-group {
    margin-bottom: 20px;
    text-align: left;
}

.abvcap-form-group:last-of-type {
    margin-bottom: 25px;
}

.abvcap-form-group label {
    display: block;
    width: 100%;
}

.abvcap-label-text {
    display: block;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    font-size: 14px;
}

.abvcap-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.abvcap-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.abvcap-input:invalid {
    border-color: #dc3232;
}

.abvcap-form-actions {
    text-align: center;
}

.abvcap-login-btn {
    background: linear-gradient(135deg, #112468 0%, #0d1a4f 100%) !important;
    color: #fff !important;
    border: none !important;
    border-color: transparent !important;
    outline: none !important;
    padding: 14px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    min-height: 50px;
}

.abvcap-login-btn:hover {
    background: linear-gradient(135deg, #0d1a4f 0%, #091236 100%) !important;
    color: #fff !important;
    border: none !important;
    border-color: transparent !important;
    outline: none !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(17, 36, 104, 0.4);
}

.abvcap-login-btn:active {
    transform: translateY(0);
    color: #fff !important;
    border: none !important;
    outline: none !important;
}

/* Forçar texto branco nos elementos internos do botão */
.abvcap-login-btn .abvcap-btn-text,
.abvcap-login-btn span,
.abvcap-login-btn * {
    color: #fff !important;
    border: none !important;
    outline: none !important;
}

.abvcap-login-btn:hover .abvcap-btn-text,
.abvcap-login-btn:hover span,
.abvcap-login-btn:hover * {
    color: #fff !important;
    border: none !important;
    outline: none !important;
}

.abvcap-login-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.abvcap-btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.abvcap-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: abvcap-spin 1s linear infinite;
}

@keyframes abvcap-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Mensagens de Feedback
   ========================================================================== */

.abvcap-login-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
}

.abvcap-login-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.abvcap-login-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.abvcap-login-message.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* ==========================================================================
   Links de Ajuda
   ========================================================================== */

.abvcap-help-links {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.abvcap-help-text {
    margin: 8px 0;
    font-size: 14px;
    color: #fff;
}

.abvcap-help-text a {
    color: #87CEEB;
    text-decoration: none;
    font-weight: 500;
}

.abvcap-help-text a:hover {
    text-decoration: underline;
    color: #B0E0E6;
}

/* ==========================================================================
   Informações do Membro Logado
   ========================================================================== */

.abvcap-member-info {
    background: #112468;
    border: 1px solid #fff;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 0 0 25px 0;
}

.abvcap-member-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.abvcap-member-icon {
    font-size: 20px;
    margin-right: 8px;
    color: #fff;
}

.abvcap-member-text {
    flex: 1;
    color: #fff;
    font-size: 16px;
}

.abvcap-member-text strong {
    color: #fff;
}

.abvcap-member-text small {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    margin-left: 8px;
}

.abvcap-logout-btn {
    background: #dc3232;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.abvcap-logout-btn:hover {
    background: #a02622;
}

/* ==========================================================================
   Modal de Ajuda
   ========================================================================== */

.abvcap-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: abvcap-fadeIn 0.3s ease;
}

.abvcap-modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: abvcap-slideIn 0.3s ease;
}

.abvcap-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px;
    border-bottom: 1px solid #eee;
}

.abvcap-modal-header h4 {
    margin: 0;
    color: #0073aa;
    font-size: 18px;
}

.abvcap-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.abvcap-modal-close:hover {
    color: #333;
}

.abvcap-modal-body {
    padding: 20px 25px 25px;
}

.abvcap-modal-body ul {
    margin: 10px 0;
    padding-left: 20px;
}

.abvcap-modal-body li {
    margin-bottom: 8px;
}

@keyframes abvcap-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes abvcap-slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Shortcode Restrito
   ========================================================================== */

.abvcap-shortcode-restricted {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
}

.abvcap-shortcode-preview {
    opacity: 0.7;
    margin-bottom: 15px;
}

.abvcap-shortcode-barrier {
    text-align: center;
    padding: 15px;
    background: white;
    border: 1px solid #0073aa;
    border-radius: 4px;
}

.abvcap-show-login-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.abvcap-show-login-btn:hover {
    background: #005a87;
}

/* ==========================================================================
   Responsividade
   ========================================================================== */

@media (max-width: 768px) {
    .abvcap-access-barrier {
        padding: 20px 15px;
        margin: 15px 0;
    }
    
    .abvcap-title {
        font-size: 20px;
    }
    
    .abvcap-description {
        font-size: 14px;
    }
    
    .abvcap-login-form {
        padding: 20px 15px;
    }
    
    .abvcap-member-welcome {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .abvcap-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .abvcap-modal-header,
    .abvcap-modal-body {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 480px) {
    .abvcap-lock-icon {
        font-size: 36px;
        margin-bottom: 15px;
    }
    
    .abvcap-title {
        font-size: 18px;
    }
    
    .abvcap-input {
        font-size: 16px; /* Evita zoom no iOS */
    }
}

/* ==========================================================================
   Acessibilidade
   ========================================================================== */

.abvcap-login-btn:focus,
.abvcap-input:focus,
.abvcap-logout-btn:focus,
.abvcap-show-login-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.abvcap-modal:focus-within {
    outline: none;
}



/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .abvcap-restricted-content,
    .abvcap-access-barrier,
    .abvcap-member-info {
        display: none !important;
    }
}

/* ==========================================================================
   Shortcode Logout Button
   ========================================================================== */

/* Botão de Logout via Shortcode */
.abvcap-logout-btn {
    background-color: #112468 !important;
    color: #fff !important;
    border: 1px solid #fff !important;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.abvcap-logout-btn:hover {
    background-color: #0d1a52 !important;
    color: #fff !important;
    border-color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.abvcap-logout-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.abvcap-logout-btn:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Responsividade do botão logout */
@media (max-width: 768px) {
    .abvcap-logout-btn {
        padding: 10px 14px;
        font-size: 14px;
    }
}

/* ==========================================================================
   Seções Restritas (Post Type: publicacao)
   ========================================================================== */

/* Container da seção restrita */
.abvcap-section-restricted {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Barreira da seção */
.abvcap-section-barrier {
    background: linear-gradient(135deg, #112468 0%, #1a2d7a 100%);
    color: #fff;
    padding: 30px;
    text-align: center;
    position: relative;
}

.abvcap-section-barrier::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    pointer-events: none;
}

/* Ícone de cadeado da seção */
.abvcap-section-barrier .abvcap-lock-icon {
    font-size: 32px;
    margin-bottom: 15px;
    opacity: 0.9;
}

/* Informações da seção */
.abvcap-section-info {
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.abvcap-section-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #fff;
}

.abvcap-section-description {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
    line-height: 1.5;
}

/* Formulário de login da seção */
.abvcap-section-login {
    max-width: 300px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.abvcap-section-login .abvcap-form-group {
    margin-bottom: 15px;
    text-align: left;
}

.abvcap-section-login .abvcap-label-text {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #fff;
    opacity: 0.9;
}

.abvcap-section-login .abvcap-form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.abvcap-section-login .abvcap-form-input::placeholder {
    color: rgba(255,255,255,0.6);
}

.abvcap-section-login .abvcap-form-input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.1);
}

.abvcap-section-login .abvcap-login-btn {
    width: 100%;
    background: #fff;
    color: #112468;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 5px;
}

.abvcap-section-login .abvcap-login-btn:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.abvcap-section-login .abvcap-login-btn:active {
    transform: translateY(0);
}

.abvcap-section-login .abvcap-login-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    display: none;
}

.abvcap-section-login .abvcap-login-message.error {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #fff;
    display: block;
}

.abvcap-section-login .abvcap-login-message.success {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #fff;
    display: block;
}

/* Responsividade das seções restritas */
@media (max-width: 768px) {
    .abvcap-section-barrier {
        padding: 20px 15px;
    }
    
    .abvcap-section-title {
        font-size: 18px;
    }
    
    .abvcap-section-login {
        max-width: 100%;
    }
    
    .abvcap-section-login .abvcap-form-input {
        font-size: 16px; /* Evita zoom no iOS */
    }
}

/* ==========================================================================
   Modal de Login (Shortcode)
   ========================================================================== */

/* Botão para abrir modal */
.abvcap-glueup-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0073aa;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.abvcap-glueup-link:hover {
    background-color: #005a87;
    color: white !important;
}

.abvcap-glueup-link:focus {
    outline: 2px solid #005a87;
    outline-offset: 2px;
}

.abvcap-glueup-link-disabled {
    display: inline-block;
    padding: 10px 20px;
    background-color: #ccc;
    color: #666;
    border-radius: 4px;
    font-style: italic;
}

.abvcap-login-modal-btn {
    background-color: #112468 !important;
    color: #fff !important;
    border: 1px solid #112468 !important;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.abvcap-login-modal-btn:hover {
    background-color: #0d1a52 !important;
    color: #fff !important;
    border-color: #0d1a52 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.abvcap-login-modal-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Modal overlay */
.abvcap-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.abvcap-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

/* Conteúdo do modal */
.abvcap-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
}

/* Cabeçalho do modal */
.abvcap-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px;
    border-bottom: 1px solid #e1e1e1;
}

.abvcap-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #112468;
}

.abvcap-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.abvcap-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Corpo do modal */
.abvcap-modal-body {
    padding: 25px;
}

.abvcap-modal-message {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

/* Formulário do modal */
.abvcap-modal-login .abvcap-form-group {
    margin-bottom: 20px;
}

.abvcap-modal-login .abvcap-label-text {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #333;
}

.abvcap-modal-login .abvcap-form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.abvcap-modal-login .abvcap-form-input:focus {
    outline: none;
    border-color: #112468;
    box-shadow: 0 0 0 2px rgba(17, 36, 104, 0.1);
}

.abvcap-modal-login .abvcap-login-btn {
    width: 100%;
    background: #112468;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.abvcap-modal-login .abvcap-login-btn:hover {
    background: #0d1a52;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.abvcap-modal-login .abvcap-login-btn:active {
    transform: translateY(0);
}

.abvcap-modal-login .abvcap-login-message {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    display: none;
}

.abvcap-modal-login .abvcap-login-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    display: block;
}

.abvcap-modal-login .abvcap-login-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    display: block;
}

/* Responsividade do modal */
@media (max-width: 768px) {
    .abvcap-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .abvcap-modal-header {
        padding: 15px 20px 10px;
    }
    
    .abvcap-modal-body {
        padding: 20px;
    }
    
    .abvcap-modal-title {
        font-size: 16px;
    }
    
    .abvcap-modal-login .abvcap-form-input {
        font-size: 16px; /* Evita zoom no iOS */
    }
}
