/* ATIA - Main Stylesheet */
/* Baseado no FEP Style Guide */

/* ========================================
   RESET & BASE STYLES
   ======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    color: #1F2937;
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

.animate-fade-in {
    animation: fadeIn 0.8s ease-out;
}

/* ========================================
   COMPONENTS
   ======================================== */

/* Level Cards */
.level-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.level-card:hover {
    transform: translateY(-8px);
}

/* Stats Cards */
.stat-card {
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: scale(1.05);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

p {
    margin-bottom: 1em;
}

/* ========================================
   READING EXPERIENCE
   ======================================== */

/* Optimal reading width */
.reading-content {
    max-width: 65ch;
    margin: 0 auto;
    line-height: 1.7;
}

.reading-content p {
    margin-bottom: 1.5em;
    color: #4B5563;
}

/* ========================================
   MARKDOWN STYLES
   ======================================== */

.markdown-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #1F2937;
}

.markdown-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #374151;
}

.markdown-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #4B5563;
}

.markdown-content ul,
.markdown-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.markdown-content li {
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.markdown-content code {
    background-color: #F3F4F6;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #374151;
}

.markdown-content pre {
    background-color: #1F2937;
    color: #F9FAFB;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* ========================================
   CALLOUT BOXES
   ======================================== */

.callout {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

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

.callout-content {
    flex: 1;
}

.callout-info {
    background: #EFF6FF;
    border-color: #3B82F6;
}

.callout-warning {
    background: #FEF3C7;
    border-color: #F59E0B;
}

.callout-tip {
    background: #ECFDF5;
    border-color: #10B981;
}

.callout-exercise {
    background: #FAF5FF;
    border-color: #8B5CF6;
}

/* ========================================
   EXPANDABLE SECTIONS
   ======================================== */

.expandable-section {
    margin: 1.5rem 0;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
}

.expand-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #F9FAFB;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    transition: background 0.2s;
}

.expand-trigger:hover {
    background: #F3F4F6;
}

.expand-icon {
    margin-left: auto;
    transition: transform 0.3s;
}

.expand-trigger.active .expand-icon {
    transform: rotate(180deg);
}

.expandable-content {
    padding: 0 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.expandable-content.active {
    padding: 1rem;
    max-height: 2000px;
}

/* ========================================
   VIDEO LINKS
   ======================================== */

.video-link {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid #E5E7EB;
    border-radius: 0.75rem;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    margin-bottom: 1rem;
}

.video-link:hover {
    border-color: #3B82F6;
    background: #EFF6FF;
    transform: translateX(4px);
}

.video-link img {
    width: 160px;
    height: 90px;
    border-radius: 0.5rem;
    object-fit: cover;
}

.video-info {
    flex: 1;
}

.video-meta {
    font-size: 0.875rem;
    color: #6B7280;
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0;
}

.external-link-icon {
    align-self: flex-start;
    color: #3B82F6;
    font-size: 1.25rem;
}

/* ========================================
   PROGRESS TRACKING
   ======================================== */

.progress-bar {
    height: 0.5rem;
    background: #E5E7EB;
    border-radius: 9999px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6, #8B5CF6);
    transition: width 0.5s ease-out;
}

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #E5E7EB;
    z-index: 100;
}

.reading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #3B82F6);
    transition: width 0.1s linear;
}

/* ========================================
   TOOLTIPS
   ======================================== */

.tooltip {
    position: relative;
    display: inline-block;
    border-bottom: 1px dotted #3B82F6;
    cursor: help;
}

.tooltip-content {
    visibility: hidden;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1F2937;
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    width: 250px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .markdown-content h1 {
        font-size: 1.75rem;
    }

    .markdown-content h2 {
        font-size: 1.5rem;
    }

    .video-link {
        flex-direction: column;
    }

    .video-link img {
        width: 100%;
        height: auto;
    }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */

@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

*:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
    border-radius: 4px;
}

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

    html {
        scroll-behavior: auto;
    }
}

/* ========================================
   SELECTION STYLING
   ======================================== */

::selection {
    background-color: #3B82F6;
    color: white;
}

::-moz-selection {
    background-color: #3B82F6;
    color: white;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    nav, footer, .no-print {
        display: none;
    }

    * {
        background: white !important;
        color: black !important;
    }
}
