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

:root {
    --primary-color: #054882;
    --secondary-color: #1e40af;
    --primary-blue: #02064b;
    --secondary-red: #e74c3c;
    --primary-blue-claro: #2563eb;
    --accent-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --gradient-primary: linear-gradient(135deg, var(--primary-blue-claro), var(--primary-blue));
    --white: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-size: 16px;
}

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

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
}

header::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"><circle cx="50" cy="50" r="2" fill="white" opacity="0.1"/></svg>') repeat;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-100px); }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 1rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: bold;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.25rem);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInUp 1s ease-out 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Article Styles */
.article-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    margin-top: 3rem;
}

.article-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    min-width: 0; /* Previne overflow */
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.reading-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reading-time::before {
    content: '⏱️';
}

.article-content h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    color: var(--primary-color);
    word-wrap: break-word;
}

.article-content h2 {
    font-size: clamp(1.5rem, 3vw, 1.8rem);
    margin: 2rem 0 1rem 0;
    color: var(--secondary-color);
    border-left: 4px solid var(--accent-color);
    padding-left: 1rem;
    word-wrap: break-word;
}

.article-content h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.4rem);
    margin: 1.5rem 0 1rem 0;
    color: var(--text-primary);
    word-wrap: break-word;
}

.article-content p {
    margin-bottom: 1.5rem;
    font-size: clamp(1rem, 2vw, 1.1rem);
    text-align: justify;
    word-wrap: break-word;
}

.article-content ul, .article-content ol {
    margin: 1rem 0 1.5rem 2rem;
    word-wrap: break-word;
}

.article-content li {
    margin-bottom: 0.5rem;
    font-size: clamp(1rem, 2vw, 1.1rem);
}

/* Sidebar Styles */
.sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
    min-width: 0;
}

.toc {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.toc h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.toc ul {
    list-style: none;
}

.toc li {
    margin-bottom: 0.5rem;
}

.toc a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 6px;
    display: block;
    transition: all 0.3s ease;
    word-wrap: break-word;
}

.toc a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

.toc a.active {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

/* Highlight Boxes */
.highlight-box {
    background: linear-gradient(135deg, #fef3c7, #fcd34d);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 2rem 0;
    border-left: 4px solid var(--accent-color);
    word-wrap: break-word;
}

.highlight-box h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.tip-box {
    background: linear-gradient(135deg, #dcfce7, #86efac);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 2rem 0;
    border-left: 4px solid #10b981;
    word-wrap: break-word;
}

.tip-box h4 {
    color: #065f46;
    margin-bottom: 1rem;
}

.warning-box {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left: 4px solid #ff9800;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
    word-wrap: break-word;
}

.success-box {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    border-left: 4px solid #4caf50;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
    word-wrap: break-word;
}

/* Statistics Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-top: 3px solid #3498db;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #3498db;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-card:hover .stat-number {
    animation: pulse 2s infinite;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Key Points Section */
.key-points {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    margin: 2rem 0;
    word-wrap: break-word;
}

.key-points h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.key-points ul {
    list-style: none;
    padding-left: 0;
}

.key-points li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    word-wrap: break-word;
    color: var(--text-primary);
}

.key-points li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}

/* Section Styles */
.section {
    margin-bottom: 3rem;
    scroll-margin-top: 2rem;
}

.section h2 {
    color: #2c3e50;
    font-size: clamp(1.5rem, 3vw, 1.8rem);
    margin-bottom: 1.5rem;
    border-left: 4px solid #3498db;
    padding-left: 1rem;
    word-wrap: break-word;
}

.section h3 {
    color: #34495e;
    font-size: clamp(1.2rem, 2.5vw, 1.4rem);
    margin-bottom: 1rem;
    margin-top: 2rem;
    word-wrap: break-word;
}

.section h4 {
    color: #5a6c7d;
    font-size: clamp(1.1rem, 2vw, 1.2rem);
    margin-bottom: 0.8rem;
    margin-top: 1.5rem;
    word-wrap: break-word;
}

.section p {
    margin-bottom: 1.2rem;
    font-size: clamp(1rem, 2vw, 1.05rem);
    text-align: justify;
    word-wrap: break-word;
}

/* References Section */
.references {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 3rem;
    word-wrap: break-word;
}

.references h2 {
    color: var(--primary-color);
    border-left: none;
    padding-left: 0;
}

.references ol {
    margin-left: 1rem;
}

.references li {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    word-wrap: break-word;
}

.references a {
    color: var(--primary-color);
    text-decoration: none;
    word-break: break-all;
}

.references a:hover {
    text-decoration: underline;
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    z-index: 1000;
    transition: width 0.3s ease;
}

/* CTA Section */
.cta-section {
    background: var(--gradient-primary);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    margin: 3rem 0;
    border-radius: 15px;
    word-wrap: break-word;
}

.cta-section h3 {
    color: #86efac;
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin-bottom: 2rem;
}

/* CTA Button */
.cta-button {
    width: auto;
    background: var(--secondary-red);
    color: var(--white) !important;
    margin-left: 20px;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 3px 15px rgba(231, 76, 60, 0.3);
    animation: pulse 1.5s infinite;
    display: inline-block;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.cta-button:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(231, 76, 60, 0.4);
    color: var(--white) !important;
    text-decoration: none;
}

/* Footer */
.footer-section {
    padding: 25px 0 15px;
    border-top: 1px solid rgba(255, 230, 3, 0.1);
    background: #054882;
    color: #fafafb;
}

.logofooter {
    max-width: 200px;
    width: 100%;
    height: auto;
}

.footer-right {
    text-align: right;
    color: #fafafb;
}

.textorubiweb {
    color: #FFB206;
    text-decoration: none;
}

/* Enhanced Button Styles */
.button {
    transition: all 0.3s ease;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 3px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Focus styles */
a:focus, button:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.toc a:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Animations */
.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

/* Dark mode styles */
.dark-mode {
    --secondary-color: #2563eb;
    --accent-color: #f59e0b;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --border-color: #374151;
}

.dark-mode .article-content {
    background: var(--bg-secondary);
    margin-bottom: 1.5rem;
}

.dark-mode .highlight-box {
    background: linear-gradient(135deg, #92400e, #d97706);
}

.dark-mode .tip-box {
    background: linear-gradient(135deg, #047857, #10b981);
}

.dark-mode .references {
    background: var(--bg-primary);
}

.dark-mode .toc {
    background: var(--bg-primary);
}

.dark-mode .stat-card {
    background: var(--bg-secondary);
}

/* RESPONSIVE DESIGN */

/* Large screens (1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
        padding: 0 30px;
    }
    
    .article-container {
        gap: 4rem;
    }
    
}

/* Medium screens (768px to 1199px) */
@media (max-width: 1199px) {
    .container {
        max-width: 100%;
        padding: 0 25px;
    }
    
    .article-container {
        grid-template-columns: 1fr 250px;
        gap: 2rem;
    }
    
    .sidebar {
        top: 1rem;
    }
    .section, span p{
        font-size: 2rem;
    }
    .container p{
        font-size: 2rem;
    }
   
}

/* Tablets (768px to 1023px) */
@media (max-width: 1023px) {
    .article-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .sidebar {
        position: static;
        order: -1;
    }
    
    .toc {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    .toc li {
    font-size: 2rem;
    }
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }
    .estilizando-li li{
        font-size: 1.2rem;
    }
    
    
}

/* Mobile landscape (768px and down) */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    .article-content {
        padding: 1.5rem;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .cta-section {
        padding: 2rem 1rem;
        margin: 2rem 0;
    }
    
    .cta-button {
        padding: 10px 25px;
        margin-top: 30px;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-right {
        text-align: center;
        margin-top: 1rem;
    }
    
    .logofooter {
        max-width: 150px;
    }
    .p{
        font-size: 1.5rem;
    }
    .toc li {
    font-size: 2rem;
    }
    .estilizando-li li{
        font-size: 1.4rem;
    }
        
   
}

/* Mobile portrait (480px and down) */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .article-content {
        padding: 1rem;
    }
    
    .article-content ul, .article-content ol {
        margin-left: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .highlight-box,
    .tip-box,
    .warning-box,
    .success-box {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .key-points {
        padding: 1rem;
    }
    
    .references {
        padding: 1rem;
    }
    
    .cta-section {
        padding: 1.5rem 1rem;
    }
    
    .toc {
        padding: 1rem;
    }
    .toc li {
    font-size: 1.7rem;
    }
    
    .logofooter {
        max-width: 120px;
    }
    .p{
        font-size: 1.2rem;
    }
    .estilizando-li li{
        font-size: 1.4rem;
    }
       
}

/* Extra small screens (360px and down) */
@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }
    
    .article-content {
        padding: 0.75rem;
    }
    
    .hero-content {
        padding: 0 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .highlight-box,
    .tip-box,
    .warning-box,
    .success-box,
    .key-points {
        padding: 0.75rem;
    }
    
    .references {
        padding: 0.75rem;
    }
    
    .cta-section {
        padding: 1rem 0.75rem;
    }
    
    .toc {
        padding: 0.75rem;
    }
    .toc li {
    font-size: 1.7rem;
    }
    .p{
        font-size: 1.2rem;
    }
    .estilizando-li li{
        font-size: 1.4rem;
    }
    
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000080;
        --secondary-color: #000060;
        --text-primary: #000000;
        --text-secondary: #333333;
    }
    
    .highlight-box,
    .tip-box,
    .warning-box,
    .success-box {
        border: 2px solid var(--text-primary);
    }
    
    .stat-card {
        border: 1px solid var(--border-color);
    }
    .li{
        color: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print optimizations */
@media print {
    .progress-bar,
    .sidebar,
    header::before,
    [style*="position: fixed"] {
        display: none !important;
    }
    
    .article-container {
        grid-template-columns: 1fr !important;
    }
    
    .article-content {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .highlight-box,
    .tip-box,
    .warning-box,
    .success-box {
        border: 1px solid #ccc !important;
        background: #f9f9f9 !important;
        break-inside: avoid;
    }
    
    h1, h2, h3 {
        break-after: avoid;
    }
    
    .references {
        break-before: always;
    }
    
    .references a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .cta-section {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
    
    .cta-button {
        background: #333 !important;
        color: #fff !important;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-content {
        padding: 0.5rem;
    }
    
    .article-content {
        padding: 1rem;
    }
    
    .cta-section {
        padding: 1.5rem 1rem;
    }
}

/* Tags */
.article-tags {
    margin: 2rem 0;
        }
        
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
        }
        
.tag {
    background: #e5e7eb;
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.3s ease;
        }
        
.tag:hover {
            background: var(--primary-color);
            color: white;
        }
