/*
Theme Name: AI News Shop
Theme URI: https://ainewspublisher.shop
Author: PremiumWP
Description: Optimized theme for license sales and SaaS. Version 1.9.17 with bug fixes.
Version: 1.9.17
*/

/* ==========================================================================
   1. Base Styles & Variables
   ========================================================================== */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e293b;
    --accent-color: #f59e0b;
    --text-color: #334155;
    --bg-color: #f8fafc;
    --font-main: "Inter", sans-serif;
    --container-width: 1200px;
}

* { box-sizing: border-box; }

body { 
    font-family: var(--font-main); 
    color: var(--text-color); 
    background: var(--bg-color); 
    margin: 0; 
    line-height: 1.6; 
}

/* FIX: Esconde textos de acessibilidade visualmente */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

a { text-decoration: none; color: var(--primary-color); transition: 0.3s; }
a:hover { color: var(--secondary-color); }
img { max-width: 100%; height: auto; }

.container { 
    max-width: var(--container-width); 
    margin: 0 auto; 
    padding: 0 20px; 
}

/* ==========================================================================
   2. Header & Navigation
   ========================================================================== */
.site-header { 
    background: #fff; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.03); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
}

.site-header .container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    height: 80px; 
}

.main-navigation ul { 
    display: flex; 
    gap: 25px; 
    list-style: none; 
    margin: 0; 
    padding: 0;
}

.main-navigation a { 
    color: var(--secondary-color); 
    font-weight: 600; 
    font-size: 0.95rem;
}

.header-actions { 
    display: flex; 
    gap: 20px; 
    align-items: center; 
    margin-left: 30px; 
    padding-left: 30px; 
    border-left: 1px solid #e2e8f0; 
}

.header-cart-link { position: relative; color: var(--secondary-color); }
.cart-count {
    position: absolute;
    top: -8px; right: -8px;
    background: var(--accent-color);
    color: #fff;
    font-size: 10px;
    width: 16px; height: 16px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* Buttons */
.btn { 
    padding: 10px 24px; 
    border-radius: 6px; 
    font-weight: 600; 
    display: inline-flex; 
    align-items: center; 
    cursor: pointer; 
    border: 1px solid transparent; 
}
.btn-primary { background: var(--primary-color); color: #fff; }
.btn-primary:hover { background: var(--secondary-color); color: #fff; }

.btn-outline { border-color: rgba(255,255,255,0.3); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,0.1); color: #fff; }

.btn-accent { background: var(--accent-color); color: #fff; border-radius: 50px; padding: 14px 35px; }
.btn-accent:hover { background: #d97706; color: #fff; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3); }

/* ==========================================================================
   3. Hero Section
   ========================================================================== */
.hero-section { 
    background: linear-gradient(135deg, var(--secondary-color) 0%, #0f172a 100%); 
    color: #fff; 
    padding: 100px 0; 
    overflow: hidden; 
}

.hero-container { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 60px; 
    align-items: center; 
}

.hero-content-left h1 { font-size: 3.5rem; line-height: 1.1; margin: 0 0 25px; }
.hero-content-left p { font-size: 1.2rem; opacity: 0.9; margin-bottom: 30px; max-width: 500px; }

.hero-buttons { display: flex; gap: 15px; margin-bottom: 25px; }

.hero-micro-copy { 
    font-size: 0.85rem; 
    opacity: 0.7; 
    display: flex; 
    gap: 10px; 
    align-items: center; 
}

/* Glass Mockup Effect */
.glass-card-mockup { 
    background: rgba(255,255,255,0.05); 
    backdrop-filter: blur(10px); 
    border: 1px solid rgba(255,255,255,0.1); 
    border-radius: 16px; 
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg); 
    transition: 0.5s; 
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    overflow: hidden;
}
.glass-card-mockup:hover { transform: none; }
.glass-card-mockup img { display: block; width: 100%; height: auto; border-radius: 0 0 16px 16px; }

.mockup-header { 
    padding: 12px; 
    background: rgba(0,0,0,0.2); 
    display: flex; 
    gap: 8px; 
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: #ccc; }
.dot.red { background: #ef4444; } 
.dot.yellow { background: #eab308; } 
.dot.green { background: #22c55e; }

/* ==========================================================================
   4. Features Section
   ========================================================================== */
.features-section { padding: 100px 0; background: #fff; }
.section-title { text-align: center; font-size: 2.5rem; color: var(--secondary-color); margin-bottom: 10px; }

.features-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 40px; 
    margin-top: 50px; 
}

.feature-item { 
    text-align: center; 
    padding: 30px; 
    border-radius: 12px; 
    transition: 0.3s; 
}
.feature-item:hover { background: #f8fafc; transform: translateY(-5px); }

.feature-icon-wrapper {
    width: 80px; height: 80px; margin: 0 auto 20px;
    background: rgba(37, 99, 235, 0.1); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.feature-icon-wrapper span { font-size: 32px; color: var(--primary-color); }
.feature-item h3 { margin: 0 0 10px; font-size: 1.25rem; }
.feature-item p { color: #64748b; font-size: 0.95rem; margin: 0; }

/* ==========================================================================
   5. Pricing Section (WooCommerce Loops)
   ========================================================================== */
.pricing-section { padding: 100px 0; background: #f1f5f9; }
.section-header { text-align: center; margin-bottom: 50px; }
.section-desc { color: #64748b; max-width: 600px; margin: 0 auto; }

.pricing-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 30px; 
}

/* Card Visual */
.pricing-grid .product { 
    background: #fff; 
    padding: 40px; 
    border-radius: 16px; 
    text-align: center; 
    list-style: none; 
    border: 1px solid #e2e8f0; 
    transition: 0.3s; 
    display: flex; flex-direction: column;
}

.pricing-grid .product:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 20px 40px rgba(0,0,0,0.1); 
}

/* Título e Preço */
.pricing-grid .product h2.woocommerce-loop-product__title { 
    font-size: 1.5rem; 
    margin: 0 0 10px; 
    color: var(--secondary-color); 
}
.pricing-grid .product .price { 
    font-size: 2.5rem; 
    font-weight: 800; 
    color: var(--secondary-color); 
    display: block; 
    margin-bottom: 20px; 
}

/* Botão dentro do loop */
.pricing-grid .product .button { 
    display: block; 
    width: 100%;
    background: var(--secondary-color); 
    color: #fff; 
    padding: 14px; 
    border-radius: 8px; 
    margin-top: auto; /* Empurra para o fundo */
    font-weight: 600;
}
.pricing-grid .product .button:hover { background: var(--primary-color); }

/* Destaque para o produto do meio (exemplo visual) */
.pricing-grid .product:nth-child(2) { 
    border: 2px solid var(--primary-color); 
    transform: scale(1.05); 
    z-index: 10; 
    position: relative;
}
.pricing-grid .product:nth-child(2)::before {
    content: "Most Popular";
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--primary-color); color: #fff;
    padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 700;
}
.pricing-grid .product:nth-child(2) .button { background: var(--primary-color); }

.guarantee-badge { 
    text-align: center; margin-top: 40px; 
    display: flex; align-items: center; justify-content: center; gap: 10px;
    color: #64748b; font-weight: 500;
}

/* ==========================================================================
   6. FAQ & CTA
   ========================================================================== */
.faq-section { padding: 80px 0; background: #fff; }
.faq-grid { max-width: 800px; margin: 40px auto; }

details { margin-bottom: 15px; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
summary { padding: 20px; font-weight: 600; cursor: pointer; background: #f8fafc; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::after { content: "+"; font-size: 1.2rem; }
details[open] summary::after { content: "-"; }
details[open] summary { background: #fff; border-bottom: 1px solid #e2e8f0; color: var(--primary-color); }
details p { padding: 20px; margin: 0; color: #64748b; }

.cta-section { background: var(--secondary-color); color: #fff; padding: 80px 0; text-align: center; }
.cta-section h2 { margin-top: 0; }

/* ==========================================================================
   7. Footer
   ========================================================================== */
.site-footer { background: #0f172a; color: #94a3b8; padding: 60px 0 30px; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }

/* ==========================================================================
   8. LOGIN POPUP / MODAL (SaaS Style)
   ========================================================================== */
.login-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(5px);
    z-index: 9999; display: none; align-items: center; justify-content: center;
    animation: fadeIn 0.3s forwards;
}

.login-modal-content {
    background: #fff; width: 95%; max-width: 420px; padding: 40px;
    border-radius: 12px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    position: relative; animation: slideUp 0.3s forwards;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.close-modal-btn {
    position: absolute; top: 15px; right: 15px; background: transparent;
    border: none; font-size: 28px; color: #cbd5e1; cursor: pointer; line-height: 1;
}
.close-modal-btn:hover { color: #ef4444; }

.login-modal-header { margin-bottom: 25px; text-align: center; }
.login-modal-header h3 { margin: 0 0 10px; font-size: 1.5rem; color: var(--secondary-color); }
.login-modal-header p { margin: 0; color: #64748b; font-size: 0.9rem; }

/* Resetando estilos do WooForm dentro do Modal */
.login-modal-content form.woocommerce-form-login {
    border: none; padding: 0; margin: 0;
}

/* FIX DEFINITIVO: Garante que TODAS as linhas fiquem um abaixo da outra */
.login-modal-content .form-row,
.login-modal-content p.form-row,
.login-modal-content .form-row-first,
.login-modal-content .form-row-last,
.login-modal-content .woocommerce-form-row {
    width: 100% !important; /* Força largura total */
    float: none !important; /* Impede flutuação lateral */
    display: block !important; /* Garante bloco */
    clear: both !important; /* Limpa elementos anteriores */
    margin-bottom: 20px !important;
    padding: 0 !important;
}

.login-modal-content label {
    display: flex;
    align-items: center;
    margin-bottom: 6px; 
    font-weight: 500; 
    font-size: 0.9rem; 
    color: var(--secondary-color);
}
.login-modal-content label .required {
    color: #ef4444; 
    text-decoration: none; 
    margin-left: 4px;
    visibility: visible;
}

/* Estilo unificado para TODOS os inputs */
.login-modal-content input.input-text,
.login-modal-content input[type="text"],
.login-modal-content input[type="password"],
.login-modal-content input[type="email"] {
    width: 100% !important; 
    height: 48px; 
    padding: 0 15px; 
    margin: 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px; 
    font-size: 1rem; 
    color: var(--text-color); 
    box-sizing: border-box;
    display: block;
    line-height: normal; 
}

.login-modal-content input:focus {
    border-color: var(--primary-color); outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* FIX: Wrapper da senha e Ícone de Olho */
.login-modal-content .woocommerce-form-row .password-input {
    width: 100% !important;
    display: block !important;
    position: relative !important; 
}

.login-modal-content input[type="password"] {
    padding-right: 40px; 
}

/* Posicionamento do ícone de olho */
.login-modal-content .woocommerce-form-row .show-password-input {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    cursor: pointer;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.9rem;
    z-index: 10;
    padding: 0;
    margin: 0;
    height: auto;
    width: auto;
    outline: none;
    display: inline-block !important; 
}
.login-modal-content .woocommerce-form-row .show-password-input:hover {
    color: var(--primary-color);
}

/* Botão de Login Largo */
.login-modal-content button.button {
    width: 100%; padding: 14px; background: var(--primary-color);
    color: #fff; border: none; border-radius: 6px; font-weight: 600;
    font-size: 1rem; cursor: pointer; margin-top: 10px; transition: 0.2s;
}
.login-modal-content button.button:hover { background: var(--secondary-color); transform: translateY(-1px); }

.login-modal-footer {
    margin-top: 25px; padding-top: 20px; border-top: 1px solid #f1f5f9;
    text-align: center; font-size: 0.9rem; color: #64748b;
}
.register-link-modal { font-weight: 700; color: var(--primary-color); }

/* ==========================================================================
   10. Minha Conta / Dashboard Fixes
   ========================================================================== */
.woocommerce-account .woocommerce {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

/* Menu Lateral */
.woocommerce-MyAccount-navigation {
    flex: 0 0 260px; /* Largura fixa para o menu */
    border-right: 1px solid #e2e8f0;
    padding-right: 20px;
}
.woocommerce-MyAccount-navigation ul {
    list-style: none; padding: 0; margin: 0;
}
.woocommerce-MyAccount-navigation li {
    margin-bottom: 5px;
}
.woocommerce-MyAccount-navigation li a {
    display: block; padding: 12px 15px; border-radius: 6px;
    color: var(--secondary-color); font-weight: 500; transition: 0.2s;
}
.woocommerce-MyAccount-navigation li a:hover,
.woocommerce-MyAccount-navigation li.is-active a {
    background: #f1f5f9; color: var(--primary-color);
}

/* Conteúdo da Conta */
.woocommerce-MyAccount-content {
    flex: 1; /* Ocupa o resto do espaço */
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* --- FIX DE SEGURANÇA: Esconde textos padrão do Woo via CSS se o PHP falhar --- */
.woocommerce-MyAccount-content > p {
    display: none;
}
/* Reexibe apenas se for dentro de um container específico (caso adicionemos textos no futuro) */
.woocommerce-MyAccount-content .custom-content p {
    display: block;
}

/* ==========================================================================
   11. NOVO PAINEL DE CONTROLE (CARDS)
   ========================================================================== */
.custom-dashboard-welcome h3 {
    margin-top: 0; color: var(--secondary-color);
}
.custom-dashboard-welcome p {
    color: #64748b; font-size: 1.05rem; margin-bottom: 30px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}

.dash-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--secondary-color);
    text-decoration: none !important;
}

.dash-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}

.dash-card .icon-wrapper {
    width: 60px; height: 60px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
}
.dash-card .icon-wrapper span {
    font-size: 28px; color: var(--primary-color);
}

.dash-card h4 {
    margin: 0 0 10px; font-size: 1.1rem;
}
.dash-card p {
    margin: 0; font-size: 0.9rem; color: #64748b; line-height: 1.4;
    display: block !important; /* Garante que o texto do card apareça */
}

.dash-card .dash-count {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    line-height: 1;
    margin-bottom: 5px;
    display: block;
}
.dash-card .dash-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    font-weight: 600;
}

/* ==========================================================================
   12. ESTILOS PARA TABELAS DO PLUGIN (LSM)
   Garante que as tabelas de Licenças e Downloads fiquem bonitas.
   ========================================================================== */
.lsm-licenses-table, .lsm-downloads-table, .woocommerce-table--order-downloads {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.lsm-licenses-table th, .lsm-downloads-table th {
    background: #f8fafc;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--secondary-color);
    border-bottom: 1px solid #e2e8f0;
}

.lsm-licenses-table td, .lsm-downloads-table td {
    padding: 15px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.lsm-licenses-table tr:last-child td { border-bottom: none; }

/* Status Tags (usadas pelo plugin) */
.lsm-status-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}
.lsm-status-tag.active { background: #dcfce7; color: #166534; }
.lsm-status-tag.expired { background: #fee2e2; color: #991b1b; }
.lsm-status-tag.inactive { background: #f1f5f9; color: #475569; }

/* Botões dentro das tabelas */
.lsm-copy-key-btn, .lsm-download-button {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: var(--secondary-color);
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
}
.lsm-copy-key-btn:hover, .lsm-download-button:hover {
    background: #f8fafc; border-color: var(--primary-color); color: var(--primary-color);
}

/* Área da Chave de Licença */
.lsm-license-key-wrapper code {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--primary-color);
    border: 1px solid #e2e8f0;
}

/* ==========================================================================
   13. Responsive (General)
   ========================================================================== */
@media (max-width: 900px) {
    .woocommerce-account .woocommerce {
        flex-direction: column;
        gap: 20px;
    }
    .woocommerce-MyAccount-navigation {
        flex: 0 0 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 20px;
        padding-right: 0;
    }
    .woocommerce-MyAccount-navigation ul {
        display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px;
    }
    .woocommerce-MyAccount-navigation li a {
        white-space: nowrap; background: #f8fafc;
    }
}

@media (max-width: 768px) {
    .hero-container { grid-template-columns: 1fr; text-align: center; }
    .hero-buttons, .hero-micro-copy { justify-content: center; }
    .hero-visual-right { display: none; }
    
    .site-header .container { flex-direction: column; height: auto; padding: 15px; }
    .main-navigation ul { gap: 15px; font-size: 0.9rem; margin-top: 15px; }
    .header-actions { margin: 15px 0 0 0; padding: 0; border: none; }
    
    .hero-content-left h1 { font-size: 2.5rem; }
}