/**
 * EXPERTZY INTELIGÊNCIA TRIBUTÁRIA
 * © 2025 Expertzy Inteligência Tributária
 * Desenvolvido com tecnologia avançada para soluções tributárias
 *
 * Cores Corporativas:
 * - Vermelho Expertzy: #FF002D
 * - Azul Naval: #091A30  
 * - Cinza Claro: #FFFFFF
 *
 * Tipografia:
 * - Principal: gadeg thin (fallback: Inter)
 * - Secundária: BRFirma Medium (fallback: Inter)
 */

:root {
    --expertzy-red: #FF002D;
    --expertzy-blue: #091A30;
    --expertzy-light: #FFFFFF;
    --expertzy-gray: #F8F9FA;
    --expertzy-border: #E9ECEF;
    --expertzy-text-light: #6C757D;
    
    --font-primary: 'Inter', 'gadeg thin', sans-serif;
    --font-secondary: 'Inter', 'BRFirma Medium', sans-serif;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s ease;
}

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-secondary);
    font-weight: 400;
    line-height: 1.6;
    color: var(--expertzy-blue);
    background-color: var(--expertzy-light);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Redesign */
.header {
    background: linear-gradient(135deg, var(--expertzy-red) 0%, #e6002a 50%, var(--expertzy-red) 100%);
    color: var(--expertzy-light);
    padding: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(9, 26, 48, 0.15);
    backdrop-filter: blur(10px);
}

.header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--expertzy-red) 0%, var(--expertzy-blue) 50%, var(--expertzy-red) 100%);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 90px;
    padding: 1rem 0;
}

/* Logo Section */
.logo-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.logo-oficial {
    width: 180px;
    height: 50px;
    object-fit: contain;
    transition: var(--transition);
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logo-oficial:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

.logo-divider {
    width: 2px;
    height: 55px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
}

.brand-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-name {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 1.8rem;
    letter-spacing: 1px;
    margin: 0;
    color: var(--expertzy-light);
}

.brand-tagline {
    font-size: 0.8rem;
    letter-spacing: 0.8px;
    opacity: 0.95;
    font-weight: 400;
    text-transform: uppercase;
}

/* Desktop Navigation */
.nav-desktop {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--expertzy-light);
    text-decoration: none;
    font-weight: 500;
    padding: 0.7rem 1.2rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    font-size: 0.9rem;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--expertzy-light);
    transition: width 0.3s ease;
}

.nav-link:hover::before {
    width: 80%;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-icon {
    font-size: 1.1rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.nav-text {
    font-family: var(--font-secondary);
}

.nav-badge {
    background: var(--expertzy-blue);
    color: var(--expertzy-light);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(9, 26, 48, 0.3);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-site-oficial {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--expertzy-blue);
    color: var(--expertzy-light);
    text-decoration: none;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-site-oficial:hover {
    background: var(--expertzy-light);
    color: var(--expertzy-blue);
    border-color: var(--expertzy-blue);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(9, 26, 48, 0.2);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hamburger-line {
    width: 24px;
    height: 3px;
    background: var(--expertzy-light);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--expertzy-blue);
    box-shadow: 0 8px 24px rgba(9, 26, 48, 0.2);
    backdrop-filter: blur(10px);
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

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

.mobile-nav-list {
    list-style: none;
    padding: 1rem 0;
}

.mobile-nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-item:last-child {
    border-bottom: none;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--expertzy-light);
    text-decoration: none;
    padding: 1rem 1.5rem;
    font-weight: 500;
    transition: var(--transition);
}

.mobile-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--expertzy-light);
}

.mobile-nav-link.external::after {
    content: '↗';
    margin-left: auto;
    opacity: 0.7;
}

/* Main Content */
.main {
    margin-top: 110px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--expertzy-blue) 0%, rgba(9, 26, 48, 0.9) 100%);
    color: var(--expertzy-light);
    padding: 6rem 0;
    text-align: center;
}

.hero-title {
    font-family: var(--font-primary);
    font-weight: 300;
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}

.hero-description {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 3rem;
    opacity: 0.9;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-top: 3rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--expertzy-red);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* POPs Section */
.pops-section {
    padding: 6rem 0;
    background-color: var(--expertzy-gray);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-family: var(--font-primary);
    font-weight: 300;
    font-size: 2.5rem;
    color: var(--expertzy-blue);
    margin-bottom: 2rem;
}

.search-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-input,
.category-filter {
    padding: 1rem 1.5rem;
    border: 2px solid var(--expertzy-border);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: var(--font-secondary);
    background-color: var(--expertzy-light);
    color: var(--expertzy-blue);
    transition: var(--transition);
}

.search-input:focus,
.category-filter:focus {
    outline: none;
    border-color: var(--expertzy-red);
    box-shadow: 0 0 0 3px rgba(255, 0, 45, 0.1);
}

.search-input {
    min-width: 300px;
}

/* POPs Grid */
.pops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.pop-card {
    background: var(--expertzy-light);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    cursor: pointer;
}

.pop-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.pop-card-header {
    background: linear-gradient(135deg, var(--expertzy-red) 0%, #e6002a 100%);
    color: var(--expertzy-light);
    padding: 1.5rem;
    position: relative;
}

.pop-category {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 1rem;
    font-weight: 600;
}

.pop-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.pop-version {
    font-size: 0.9rem;
    opacity: 0.8;
}

.pop-card-body {
    padding: 1.5rem;
}

.pop-description {
    color: var(--expertzy-text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.pop-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--expertzy-text-light);
}

.pop-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pop-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-family: var(--font-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--expertzy-red);
    color: var(--expertzy-light);
}

.btn-primary:hover {
    background-color: #e6002a;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--expertzy-blue);
    border: 2px solid var(--expertzy-border);
}

.btn-secondary:hover {
    background-color: var(--expertzy-blue);
    color: var(--expertzy-light);
    border-color: var(--expertzy-blue);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--expertzy-light);
    border-radius: var(--border-radius-lg);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: var(--expertzy-blue);
    color: var(--expertzy-light);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    position: relative;
    box-shadow: 0 2px 12px rgba(9, 26, 48, 0.15);
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--expertzy-red) 0%, var(--expertzy-blue) 100%);
}

.modal-header h2 {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 18px;
    margin: 0;
    flex: 1;
    color: var(--expertzy-light);
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header h2::before {
    content: '📋';
    background: var(--expertzy-light);
    color: var(--expertzy-red);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-close {
    background: transparent;
    border: 2px solid var(--expertzy-light);
    color: var(--expertzy-light);
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-left: 1rem;
}

.btn-close:hover {
    background: var(--expertzy-red);
    border-color: var(--expertzy-red);
    color: var(--expertzy-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 0, 45, 0.3);
}

.modal-body {
    background: var(--expertzy-light);
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
    flex: 1;
}

/* Scrollbar personalizada */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #F8F9FA;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--expertzy-blue);
    border-radius: 4px;
    transition: var(--transition);
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--expertzy-red);
}

.pop-content {
    padding: 0;
    line-height: 1.6;
    color: #2D3436;
    font-size: 14px;
}

.pop-content h1,
.pop-content h2,
.pop-content h3,
.pop-content h4 {
    color: var(--expertzy-blue);
    margin: 24px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #E9ECEF;
    font-family: var(--font-primary);
    font-weight: 600;
}

.pop-content h1 {
    font-size: 2rem;
    margin-top: 0;
}

.pop-content h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid var(--expertzy-red);
    padding-bottom: 8px;
}

.pop-content h3 {
    font-size: 1.3rem;
}

.pop-content h4 {
    font-size: 1.1rem;
}

.pop-content p {
    margin-bottom: 16px;
    text-align: justify;
}

.pop-content ul,
.pop-content ol {
    margin-left: 24px;
    margin: 16px 0;
}

.pop-content li {
    margin-bottom: 8px;
}

.pop-content code {
    background-color: var(--expertzy-gray);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.pop-content pre {
    background-color: var(--expertzy-gray);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin-bottom: 1rem;
}

.pop-content blockquote {
    border-left: 4px solid var(--expertzy-red);
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: var(--expertzy-text-light);
}

.pop-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.pop-content th,
.pop-content td {
    padding: 0.8rem;
    border: 1px solid var(--expertzy-border);
    text-align: left;
}

.pop-content th {
    background-color: var(--expertzy-blue);
    color: var(--expertzy-light);
    font-weight: 600;
}

/* Contact Section */
.contact-section {
    padding: 6rem 0;
    background: linear-gradient(135deg, var(--expertzy-blue) 0%, rgba(9, 26, 48, 0.9) 100%);
    color: var(--expertzy-light);
}

.contact-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.contact-info h2 {
    font-family: var(--font-primary);
    font-weight: 300;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-info p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.contact-methods {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    background-color: var(--expertzy-red);
    color: var(--expertzy-light);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.contact-btn:hover {
    background-color: #e6002a;
    transform: translateY(-2px);
}

.contact-btn.email {
    background-color: transparent;
    border: 2px solid var(--expertzy-light);
}

.contact-btn.email:hover {
    background-color: var(--expertzy-light);
    color: var(--expertzy-blue);
}

.contact-icon {
    width: 1.2rem;
    height: 1.2rem;
}

.contact-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
}

.illustration-placeholder {
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    backdrop-filter: blur(10px);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--expertzy-text-light);
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--expertzy-blue);
}

/* Footer */
.footer {
    background-color: var(--expertzy-blue);
    color: var(--expertzy-light);
    padding: 2rem 0;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-info p {
    margin: 0;
    opacity: 0.9;
}

.footer-info p:first-child {
    font-weight: 600;
}

.footer-links a {
    color: var(--expertzy-light);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--expertzy-red);
}

/* Print Styles */
@media print {
    .header,
    .modal-header,
    .contact-section,
    .footer {
        display: none;
    }
    
    .main {
        margin-top: 0;
    }
    
    .pop-content {
        padding: 0;
        font-size: 12pt;
        line-height: 1.5;
        color: black;
    }
    
    .pop-content h1,
    .pop-content h2,
    .pop-content h3,
    .pop-content h4 {
        color: black;
        page-break-after: avoid;
    }
    
    .pop-content h2 {
        border-bottom: 2pt solid black;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    /* Header Mobile */
    .nav-desktop {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .main {
        margin-top: 85px;
    }
    
    .header-content {
        min-height: 75px;
        padding: 0.8rem 0;
    }
    
    .logo-section {
        gap: 1rem;
    }
    
    .logo-oficial {
        width: 140px;
        height: 38px;
        object-fit: contain;
        background: white;
        padding: 6px 10px;
        border-radius: 4px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }
    
    .brand-name {
        font-size: 1.4rem;
    }
    
    .brand-tagline {
        font-size: 0.7rem;
    }
    
    .logo-divider {
        height: 35px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        gap: 2rem;
    }
    
    .search-filter {
        flex-direction: column;
        align-items: center;
    }
    
    .search-input {
        min-width: auto;
        width: 100%;
    }
    
    .pops-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .contact-methods {
        justify-content: center;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .modal {
        padding: 1rem;
    }
    
    .modal-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .modal-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .contact-btn {
        flex: 1;
        justify-content: center;
    }
}

/* Mermaid Diagram Styles */
.mermaid-container {
    margin: 2rem 0;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow-x: auto;
    display: flex;
    justify-content: center;
}

.mermaid {
    max-width: 100%;
    text-align: center;
}

/* Override Mermaid default styles to match brand */
.mermaid .node rect,
.mermaid .node circle,
.mermaid .node ellipse,
.mermaid .node polygon,
.mermaid .node path {
    stroke: var(--expertzy-blue) !important;
}

.mermaid .node.clickable {
    cursor: pointer;
}

.mermaid .edgeLabel {
    background-color: white;
    padding: 2px 4px;
    border-radius: 4px;
}

.mermaid .flowchart-link {
    stroke: var(--expertzy-blue) !important;
}

/* Print styles for Mermaid */
@media print {
    .mermaid-container {
        page-break-inside: avoid;
        background-color: white;
        border: 1px solid #ddd;
    }
    
    .mermaid svg {
        max-width: 100%;
        height: auto;
    }
}