/* CSS Variables for theming */
:root {
    --primary-color: #3C2415;
    --secondary-color: #6F4E37;
    --accent-color: #A67B5B;
    --light-accent: #C4915C;
    --background-color: #E6D5AA;
    --text-color: #3C2415;
    --text-light: #6F4E37;
    --white: #FFFFFF;
    --danger: #DC3545;
    --success: #28A745;
    --warning: #FFC107;
    --info: #17A2B8;
    
    --shadow-light: 0 2px 10px rgba(60, 36, 21, 0.1);
    --shadow-medium: 0 4px 20px rgba(60, 36, 21, 0.15);
    --shadow-heavy: 0 8px 30px rgba(60, 36, 21, 0.2);
    
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
}

/* Dark theme variables */
[data-theme="dark"] {
    --primary-color: #E6D5AA;
    --secondary-color: #C4915C;
    --accent-color: #A67B5B;
    --light-accent: #6F4E37;
    --background-color: #2C1810;
    --text-color: #E6D5AA;
    --text-light: #C4915C;
    --white: #3C2415;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* Header and Navigation */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow-light);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: var(--transition);
}

.nav__container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav__logo {
    display: flex;
    align-items: center;
}

.nav__logo-title {
    margin: 0;
}

.nav__logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.nav__logo-image {
    height: 32px;
    width: auto;
    display: block;
}

.nav__logo-text {
    display: inline-block;
}

.nav__menu {
    display: flex;
    align-items: center;
}

.nav__list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav__link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.nav__link:hover,
.nav__link:focus {
    background-color: var(--background-color);
    color: var(--primary-color);
}

.nav__controls {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    margin-left: auto; /* empurra controles (e o hambúrguer) para a direita */
}

/* Botões de tema e linguagem mais compactos */
#lang-toggle,
#lang-toggle-privacy,
#theme-toggle {
    padding: 0.3rem 0.8rem;
    min-width: auto;
    font-size: var(--font-size-sm);
    line-height: 1;
    border-radius: 999px;
}

.nav__toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 0.25rem; /* pequeno espaço apenas entre toggles e hambúrguer */
}

.nav__toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 3px 0;
    transition: var(--transition);
}

/* Progress Bar */
.progress-container {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--background-color);
    z-index: 999;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    width: 0%;
    transition: width 0.3s ease;
}

/* Main Content */
.main {
    margin-top: 84px;
    min-height: calc(100vh - 84px);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.hero__content {
    max-width: 600px;
    margin: 0 auto;
}

.hero__title {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero__subtitle {
    font-size: var(--font-size-lg);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero__helper {
    margin-top: 2rem;
    text-align: left;
    background-color: rgba(255, 255, 255, 0.12);
    border-radius: var(--border-radius);
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow-light);
}

.hero__helper-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.hero__helper-list {
    list-style: none;
    counter-reset: hero-helper-counter;
    padding-left: 0;
}

.hero__helper-list li {
    counter-increment: hero-helper-counter;
    margin-bottom: 0.75rem;
    padding-left: 2.2rem;
    position: relative;
    font-size: var(--font-size-sm);
}

.hero__helper-list li::before {
    content: counter(hero-helper-counter);
    position: absolute;
    left: 0;
    top: 0.1rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background-color: var(--background-color);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.hero__stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

.stat {
    text-align: center;
}

.stat__number {
    display: block;
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--background-color);
}

.stat__label {
    font-size: var(--font-size-sm);
    opacity: 0.8;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    min-width: 120px;
    gap: 0.5rem;
}

.btn--primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn--primary:hover,
.btn--primary:focus {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

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

.btn--secondary:hover,
.btn--secondary:focus {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn--danger {
    background-color: var(--danger);
    color: var(--white);
}

.btn--danger:hover,
.btn--danger:focus {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Sections */
.section {
    padding: 4rem 0;
}

.section:nth-child(even) {
    background-color: var(--white);
}

.section__header {
    text-align: center;
    margin-bottom: 3rem;
}

.section__title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.section__subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.section__actions {
    text-align: center;
    margin-top: 3rem;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    border: 1px solid transparent;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
    border-color: var(--accent-color);
}

.card__icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.card__title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.card__description {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.card__severity {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card__severity--low {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.card__severity--medium {
    background-color: rgba(255, 193, 7, 0.1);
    color: #e6ac00;
}

.card__severity--high {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

/* Techniques Container */
.techniques-container {
    display: grid;
    gap: 2rem;
}

.technique {
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.technique:hover {
    box-shadow: var(--shadow-medium);
}

.technique__header {
    background: linear-gradient(135deg, var(--accent-color), var(--light-accent));
    color: var(--white);
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.technique__title {
    font-size: var(--font-size-xl);
    font-weight: 600;
}

.technique__toggle {
    font-size: 1.5rem;
    transition: var(--transition);
}

.technique__content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.technique__content.active {
    padding: 2rem;
    max-height: 1000px;
}

.technique__steps {
    list-style: none;
    counter-reset: step-counter;
}

.technique__step {
    counter-increment: step-counter;
    margin-bottom: 1.5rem;
    padding-left: 3rem;
    position: relative;
}

.technique__step::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-sm);
}

/* Situations Container */
.situations-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.situation {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

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

.situation__scenario {
    background-color: var(--background-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent-color);
}

.situation__title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.situation__actions {
    margin-top: 1.5rem;
}

.situation__action {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
}

.situation__action-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.situation__action-text {
    color: var(--text-light);
}

/* Protocols Container */
.protocols-container {
    display: grid;
    gap: 2rem;
}

.protocol {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-light);
    border-left: 6px solid var(--primary-color);
}

.protocol__title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.protocol__icon {
    font-size: 2rem;
}

.protocol__checklist {
    list-style: none;
    margin-top: 1.5rem;
}

.protocol__item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.protocol__item:hover {
    background-color: var(--accent-color);
    color: var(--white);
}

.protocol__item-icon {
    color: var(--success);
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* Emergency Section */
.emergency-section {
    background: linear-gradient(135deg, var(--danger), #c82333);
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
}

.emergency-card {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.emergency-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

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

.emergency-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: 1rem;
}

.emergency-text {
    font-size: var(--font-size-lg);
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal__content {
    background-color: var(--white);
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-heavy);
    animation: modalSlideIn 0.3s ease;
}

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

.modal__header {
    padding: 2rem;
    border-bottom: 1px solid var(--background-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal__title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--primary-color);
}

.modal__close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.modal__close:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}

.modal__body {
    padding: 2rem;
}

.emergency-steps {
    list-style: none;
    counter-reset: emergency-counter;
}

.emergency-step {
    counter-increment: emergency-counter;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--danger);
    position: relative;
    padding-left: 4rem;
}

.emergency-step::before {
    content: counter(emergency-counter);
    position: absolute;
    left: 1rem;
    top: 1rem;
    width: 2rem;
    height: 2rem;
    background-color: var(--danger);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-sm);
}

.emergency-step-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.emergency-step-description {
    color: var(--text-light);
    font-size: var(--font-size-sm);
}

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

.footer__content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer__text {
    font-size: var(--font-size-sm);
    opacity: 0.9;
}

.footer__text a {
    color: var(--background-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.footer__text a:hover {
    color: var(--white);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav__menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: var(--white);
        flex-direction: column;
        justify-content: flex-start;
        padding: 2rem;
        transition: var(--transition);
        box-shadow: var(--shadow-medium);
    }
    
    .nav__menu.active {
        left: 0;
    }
    
    .nav__list {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .nav__link {
        display: block;
        padding: 1rem;
        text-align: center;
        border: 1px solid var(--background-color);
        border-radius: var(--border-radius);
    }
    
    .nav__toggle {
        display: flex;
    }
    
    .nav__toggle.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .nav__toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav__toggle.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    .hero__title {
        font-size: var(--font-size-3xl);
    }
    
    .hero__stats {
        flex-direction: column;
        gap: 1rem;
    }

    /* Header mais compacto em telas pequenas */
    .nav__container {
        padding: 0.75rem;
    }

    #lang-toggle,
    #lang-toggle-privacy,
    #theme-toggle {
        padding: 0.25rem 0.6rem;
        font-size: var(--font-size-xs);
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .situations-container {
        grid-template-columns: 1fr;
    }
    
    .situation__actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .modal__content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal__header,
    .modal__body {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    .card,
    .technique,
    .situation,
    .protocol {
        padding: 1.5rem;
    }
    
    .hero__title {
        font-size: var(--font-size-2xl);
    }
    
    .section__title {
        font-size: var(--font-size-2xl);
    }
    
    .emergency-icon {
        font-size: 3rem;
    }
}

/* 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 */
.btn:focus,
.nav__link:focus,
.modal__close:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card,
    .technique,
    .situation,
    .protocol {
        border: 2px solid var(--primary-color);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Print styles */
@media print {
    .nav,
    .progress-container,
    .section__actions,
    .emergency-section,
    .modal {
        display: none;
    }
    
    .main {
        margin-top: 0;
    }
    
    .section {
        page-break-inside: avoid;
    }
}
