/* CSS Variables для бразильского дизайна */
:root {
    /* Бразильская цветовая палитра */
    --brasil-green: #009639;      /* Основной зеленый флага */
    --brasil-yellow: #FEDF00;     /* Желтый флага */
    --brasil-blue: #012169;       /* Синий флага */
    --warm-gold: #FFD700;         /* Теплое золото для кнопок */
    --sunny-orange: #FF8C00;      /* Солнечный оранжевый */
    --carnival-purple: #8B008B;   /* Карнавальный фиолетовый */
    --tropical-teal: #20B2AA;     /* Тропический бирюзовый */
    
    /* Основные цвета */
    --primary: var(--brasil-green);
    --secondary: var(--warm-gold);
    --accent: var(--brasil-yellow);
    --background: #FFFFFF;
    --text: #1A202C;
    --text-light: #666;
    --border: #E2E8F0;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    
    /* Эффекты */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    
    /* Градиенты */
    --gradient-brasil: linear-gradient(135deg, var(--brasil-green) 0%, var(--tropical-teal) 50%, var(--brasil-blue) 100%);
    --gradient-sunset: linear-gradient(135deg, var(--warm-gold) 0%, var(--sunny-orange) 100%);
    --gradient-carnival: linear-gradient(135deg, var(--brasil-yellow) 0%, var(--warm-gold) 50%, var(--sunny-orange) 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--background);
    font-size: 16px;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 { 
    font-size: 2.5rem; 
    color: var(--primary);
}

h2 { 
    font-size: 2rem;
    color: var(--text);
}

h3 { 
    font-size: 1.5rem;
}

h4 { 
    font-size: 1.25rem;
}

p { 
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--brasil-blue);
}

/* Header & Navigation */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand .logo img {
    height: 50px;
    width: auto;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

.nav-link {
    color: var(--text);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    transform: translateY(-1px);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-brasil);
    border-radius: 2px;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    padding: 0.5rem;
}

.navbar-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text);
    transition: var(--transition);
    border-radius: 2px;
}

/* Улучшенные кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-brasil);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    color: white;
}

.btn-secondary {
    background: var(--gradient-carnival);
    color: var(--brasil-blue);
    box-shadow: var(--shadow);
    font-weight: 700;
}

.btn-secondary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-xl);
    color: var(--brasil-blue);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.btn-large {
    padding: 18px 36px;
    font-size: 1.1rem;
    border-radius: var(--border-radius-lg);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.8rem;
}

/* Улучшенный Hero Section с бразильскими мотивами */
.hero {
    background: var(--gradient-brasil);
    color: white;
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(254, 223, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(32, 178, 170, 0.1) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

.hero::after {
    content: '🇧🇷';
    position: absolute;
    font-size: 8rem;
    opacity: 0.1;
    right: 10%;
    top: 20%;
    animation: bounce 4s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    color: white;
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #FFFFFF, var(--brasil-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.hero-cta {
    margin-top: 2rem;
}

/* Улучшенные карточки разделов */
.featured-sections {
    padding: 80px 0;
    background: linear-gradient(45deg, #f8f9fa 0%, #ffffff 100%);
}

.sections-grid,
.articles-grid {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.sections-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.articles-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* Улучшенные карточки */
.section-card,
.article-card,
.related-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

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

.section-card:hover,
.article-card:hover,
.related-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.section-card h2,
.article-card h2,
.article-card h3,
.related-card h4 {
    margin-bottom: 1rem;
    color: var(--brasil-blue);
}

.section-card a,
.article-card a,
.related-card a {
    color: inherit;
}

.section-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.article-image {
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.article-image img,
.related-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.article-image:hover img {
    transform: scale(1.08);
}

/* Улучшенная секция статей */
.latest-articles {
    padding: 80px 0;
    background: white;
}

.latest-articles h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--brasil-blue);
    position: relative;
}

.latest-articles h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient-carnival);
    border-radius: 2px;
}

/* Article Styles */
.article-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.article-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.article-description {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    max-width: 800px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

.article-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 500;
    color: var(--text);
}

.author-expertise {
    font-size: 0.8rem;
    color: var(--text-light);
}

.article-categories {
    display: flex;
    gap: 0.5rem;
}

.category-tag {
    background: var(--primary);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-decoration: none;
}

.category-tag:hover {
    background: var(--secondary);
}

.article-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 1.2rem;
}

.star.filled {
    color: var(--accent);
}

.star.empty {
    color: #ddd;
}

.rating-text {
    font-weight: 500;
    color: var(--text);
}

/* Content Body */
.article-content {
    padding: 2rem 0;
}

.content-body {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.7;
}

.content-body h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.content-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.content-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    box-shadow: var(--shadow);
}

.content-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: #f8f9fa;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.content-body ul,
.content-body ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.content-body li {
    margin: 0.5rem 0;
}

.content-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

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

.content-body th {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

/* CTA Inline */
.cta-inline {
    background: var(--gradient-carnival);
    border: 2px solid var(--warm-gold);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    text-align: center;
    margin: 3rem 0;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.cta-inline::before {
    content: '🎲';
    position: absolute;
    font-size: 4rem;
    opacity: 0.1;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    animation: spin 8s linear infinite;
}

@keyframes spin {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

.cta-inline h3 {
    color: var(--brasil-blue);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.cta-inline p {
    margin-bottom: 1.5rem;
    color: var(--brasil-blue);
    font-weight: 500;
}

/* Tags & Categories */
.article-tags {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    background: var(--border);
    color: var(--text);
    padding: 4px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.tag:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

/* Author Bio */
.author-bio {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 3rem 0;
}

.author-bio-content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.author-bio-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-bio-text h3 {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.author-expertise {
    margin: 1rem 0;
}

.expertise-tag {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

.author-social {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.author-social a {
    color: var(--primary);
    font-weight: 500;
}

/* Related Articles */
.related-articles {
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 2px solid var(--border);
}

.related-articles h3 {
    margin-bottom: 2rem;
    text-align: center;
    color: var(--primary);
}

.related-card {
    padding: 1.5rem;
}

.related-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.related-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.related-card p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Legal Disclaimer */
.legal-disclaimer {
    background: linear-gradient(135deg, #fffbf0, #fff3cd);
    border: 1px solid var(--warning);
    padding: 1rem 0;
    margin-top: 2rem;
    text-align: center;
}

.legal-disclaimer p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Footer */
.site-footer {
    background: var(--text);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--accent);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: #ccc;
}

.disclaimer {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

/* Read More Links */
.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary);
    border-radius: var(--border-radius);
    transition: var(--transition);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.read-more::after {
    content: '→';
    transition: var(--transition);
}

.read-more:hover {
    background: var(--primary);
    color: white;
    transform: translateX(3px);
}

.read-more:hover::after {
    transform: translateX(3px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .navbar-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow);
        gap: 0;
        border-top: 1px solid var(--border);
    }
    
    .navbar-nav.active {
        display: flex;
    }
    
    .nav-link {
        padding: 1rem 0;
        border-bottom: 1px solid var(--border);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .article-title {
        font-size: 2rem;
    }
    
    .sections-grid,
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .article-header {
        padding: 2rem 0;
    }
    
    .article-content {
        padding: 1.5rem 0;
    }
    
    .content-body {
        font-size: 1rem;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .author-bio-content {
        flex-direction: column;
        text-align: center;
    }
    
    .author-bio-image {
        width: 60px;
        height: 60px;
        margin: 0 auto;
    }
    
    .section-card,
    .article-card,
    .related-card {
        padding: 1.5rem;
    }
    
    .cta-inline {
        padding: 1.5rem;
    }
    
    .featured-sections,
    .latest-articles {
        padding: 50px 0;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 40px 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .article-title {
        font-size: 1.8rem;
    }
    
    .btn {
        width: 100%;
        margin: 0.5rem 0;
    }
    
    .btn:not(.btn-small) {
        padding: 12px 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .cta-inline,
    .btn,
    .legal-disclaimer {
        display: none;
    }
    
    .article-content {
        padding: 0;
    }
    
    .content-body {
        max-width: none;
    }
}

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

/* Focus styles for keyboard navigation */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid var(--brasil-yellow);
    outline-offset: 2px;
}

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.hidden { display: none; }
.visible { display: block; }

/* Дополнительные анимации */
.pulse {
    animation: pulse 2s infinite;
}

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

.fade-in {
    animation: fadeIn 0.6s ease-in;
}

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