:root {
    --primary-color: #3a506b;
    --secondary-color: #5bc0be;
    --accent-color: #f8f32b;
    --dark-color: #1c2541;
    --light-color: #f9f7f4; /* Cor de papel para leitura */
    --text-color: #2c3e50; /* Texto mais suave */
    --text-light: #f8f9fa;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 15px 35px rgba(0, 0, 0, 0.2);
    
    /* Reading-optimized variables */
    --reading-bg: #f9f7f4; /* Cor de papel suave */
    --reading-text: #2c3e50; /* Texto confortável para os olhos */
    --reading-accent: #34495e; /* Cinza azulado suave */
    --reading-border: #e8e6e3; /* Bordas suaves */
}

/* Dark mode variables */
[data-theme="dark"] {
    --light-color: #1a1a1a;
    --text-color: #e4e4e4;
    --text-light: #f8f9fa;
    --dark-color: #0d1117;
    --primary-color: #58a6ff;
    --secondary-color: #7c3aed;
    --accent-color: #fbbf24;
    --reading-bg: #1a1a1a;
    --reading-text: #e4e4e4;
    --reading-accent: #a0a0a0;
    --reading-border: #333333;
    --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.4);
    --shadow-heavy: 0 15px 35px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.7; /* Melhor espaçamento para leitura */
    color: var(--reading-text);
    background-color: var(--reading-bg);
    scroll-behavior: smooth;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Mode Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
    color: white;
    font-size: 1.2rem;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-heavy);
}

/* Reading optimization for text */
h1, h2, h3, h4 {
    font-family: 'Roboto Slab', serif;
    font-weight: 600; /* Menos pesado para leitura */
    margin-bottom: 1.2rem;
    color: var(--reading-accent);
    line-height: 1.3;
}

p {
    margin-bottom: 1.8rem;
    font-size: 1.05rem; /* Ligeiramente maior para melhor leitura */
    line-height: 1.8; /* Espaçamento otimizado */
    text-align: justify;
    text-justify: inter-word;
}

/* Melhor contraste para links */
a {
    text-decoration: none;
    color: var(--secondary-color);
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

a:hover {
    border-bottom: 1px solid var(--secondary-color);
}

.container {
    width: 85%;
    max-width: 1000px; /* Largura otimizada para leitura */
    margin: 0 auto;
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(28, 37, 65, 0.8), rgba(28, 37, 65, 0.8)), 
                url('../images/ai-ethics.jpg') center/cover no-repeat;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0.9;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease-out;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    color: white;
}

.hero-content h2 {
    font-size: 2rem;
    font-weight: 300;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    color: white;
}

.article-hero {
    height: 40vh;
}

/* Navigation */
nav {
    background-color: var(--dark-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-medium);
    transition: background-color 0.3s ease;
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
}

nav li {
    margin: 0 1rem;
}

nav a {
    display: block;
    padding: 1rem 2rem;
    color: var(--text-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-bottom: none;
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-accent);
    transition: left 0.3s ease;
    z-index: -1;
}

nav a:hover::before,
nav a.active::before {
    left: 0;
}

nav a:hover,
nav a.active {
    color: var(--dark-color);
    transform: translateY(-2px);
}

/* Typography */
.lead {
    font-size: 1.3rem;
    font-weight: 500; /* Menos pesado */
    margin-bottom: 2.5rem;
    color: var(--primary-color);
    line-height: 1.6;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

blockquote {
    border-left: 4px solid var(--secondary-color);
    padding: 2rem;
    margin: 3rem 0;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--reading-accent);
    background: rgba(91, 192, 190, 0.08);
    border-radius: 8px;
    line-height: 1.7;
    transition: background-color 0.3s ease;
}

[data-theme="dark"] blockquote {
    background: rgba(91, 192, 190, 0.1);
    border-left-color: var(--secondary-color);
}

/* Articles Grid */
.articles-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 4rem 0;
    transition: background 0.3s ease;
}

[data-theme="dark"] .articles-section {
    background: linear-gradient(135deg, #0d1117 0%, #1a1a1a 100%);
}

.section-intro {
    text-align: center;
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin: 3rem 0;
}

.article-card {
    background: var(--reading-bg);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-top: 4px solid transparent;
    background-clip: padding-box;
    border: 1px solid var(--reading-border);
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.article-card:nth-child(2n)::before {
    background: var(--gradient-secondary);
}

.article-card:nth-child(3n)::before {
    background: var(--gradient-accent);
}

.article-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-heavy);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-category {
    background: var(--gradient-primary);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.article-card:nth-child(2n) .card-category {
    background: var(--gradient-secondary);
}

.article-card:nth-child(3n) .card-category {
    background: var(--gradient-accent);
}

.card-date {
    color: var(--reading-accent);
    font-size: 0.9rem;
}

.article-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--reading-accent);
    line-height: 1.3;
}

.card-excerpt {
    color: var(--reading-text);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    background: var(--reading-border);
    color: var(--reading-accent);
    padding: 0.3rem 0.7rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

[data-theme="dark"] .tag {
    background: #333333;
    color: #a0a0a0;
}

.card-link {
    display: inline-flex;
    align-items: center;
    background: var(--gradient-primary);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    border-bottom: none;
}

.article-card:nth-child(2n) .card-link {
    background: var(--gradient-secondary);
}

.article-card:nth-child(3n) .card-link {
    background: var(--gradient-accent);
}

.card-link:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
    border-bottom: none;
}

/* Single Article Page - Optimized for Reading */
.single-article {
    max-width: 750px; /* Largura ideal para leitura */
    margin: 0 auto;
    padding: 2rem;
    background: var(--reading-bg);
    border-radius: 15px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--reading-border);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--reading-border);
}

.article-category {
    background: var(--gradient-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.article-date {
    color: var(--reading-accent);
    font-weight: 500;
}

.article-tags {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.article-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid var(--reading-border);
}

.nav-back,
.nav-next {
    background: var(--gradient-primary);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: none;
}

.nav-back:hover,
.nav-next:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
    border-bottom: none;
}

/* Reading Progress Indicator */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(91, 192, 190, 0.3);
    z-index: 1001;
    transform-origin: left;
}

.reading-progress-bar {
    height: 100%;
    background: var(--secondary-color);
    width: 0%;
    transition: width 0.1s ease;
}

/* Existing Components - Updated for better reading */
.challenges-grid,
.resources-grid,
.approach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.challenge-card,
.resource-card,
.approach-card {
    background: var(--reading-bg);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--reading-border);
}

.challenge-card::before,
.resource-card::before,
.approach-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.challenge-card:nth-child(2n)::before,
.resource-card:nth-child(2n)::before,
.approach-card:nth-child(2n)::before {
    background: var(--gradient-secondary);
}

.challenge-card:nth-child(3n)::before,
.resource-card:nth-child(3n)::before,
.approach-card:nth-child(3n)::before {
    background: var(--gradient-accent);
}

.challenge-card:hover,
.resource-card:hover,
.approach-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-heavy);
}

.challenge-card h4,
.resource-card h4,
.approach-card h4 {
    color: var(--reading-accent);
    margin-bottom: 1rem;
}

.challenge-card p,
.resource-card p,
.approach-card p {
    color: var(--reading-text);
    line-height: 1.7;
}

.reaction-stages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.stage {
    background: var(--reading-bg);
    padding: 2rem;
    border-left: 4px solid var(--secondary-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--reading-border);
}

.stage:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.stage h4 {
    color: var(--reading-accent);
    margin-bottom: 1rem;
}

.stage p {
    color: var(--reading-text);
    line-height: 1.7;
}

.ethical-principles li {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-left: 4px solid var(--accent-color);
    background: rgba(248, 243, 43, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid var(--reading-border);
    list-style: none;
}

[data-theme="dark"] .ethical-principles li {
    background: rgba(248, 243, 43, 0.1);
}

.ethical-principles li:hover {
    background: rgba(248, 243, 43, 0.1);
    transform: translateX(5px);
}

[data-theme="dark"] .ethical-principles li:hover {
    background: rgba(248, 243, 43, 0.15);
}

.ethical-principles li strong {
    color: var(--reading-accent);
}

/* Footer */
footer {
    background: var(--gradient-primary);
    color: var(--text-light);
    text-align: center;
    padding: 3rem 0;
    margin-top: 4rem;
}

/* Smooth scrolling enhancement */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Focus indicators for accessibility */
*:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav li {
        margin: 0;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .article-card {
        padding: 1.5rem;
    }
    
    .single-article {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .article-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .article-tags {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    p {
        text-align: left; /* Melhor em mobile */
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 1rem 0;
    }
    
    .hero {
        height: 50vh;
    }
    
    .article-card {
        padding: 1rem;
    }
    
    .single-article {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .lead {
        font-size: 1.1rem;
        text-align: left;
    }
}
