/* Variáveis de Estilo - Tema Claro (Padrão) */
:root {
    --primary-color: #16324f;
    --primary-light: #244b75;
    --accent-color: #e3b23c;
    --accent-hover: #c99c32;
    --bg-color: #f7f8fa;
    --surface-color: #ffffff;
    --text-main: #333333;
    --text-light: #666666;
    --border-color: #e0e4e8;
    --sidebar-width: 280px;
    --transition-speed: 0.3s;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

/* Variáveis de Estilo - Tema Escuro */
[data-theme="dark"] {
    --primary-color: #0b1a29;
    --primary-light: #16324f;
    --accent-color: #f0c765;
    --accent-hover: #e3b23c;
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --text-main: #e0e0e0;
    --text-light: #a0a0a0;
    --border-color: #333333;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.6);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Sora', sans-serif;
    color: var(--primary-color);
}

[data-theme="dark"] h1, 
[data-theme="dark"] h2, 
[data-theme="dark"] h3, 
[data-theme="dark"] h4, 
[data-theme="dark"] h5, 
[data-theme="dark"] h6 {
    color: #ffffff;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Acessibilidade: Foco de Navegação */
:focus {
    outline: none;
}

a:focus-visible, 
button:focus-visible, 
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Animações (Intersection Observer) */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Estrutura Principal */
#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--primary-color);
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-speed) ease;
}

#content {
    margin-left: var(--sidebar-width);
    padding: 3rem;
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    transition: width var(--transition-speed), margin var(--transition-speed);
}

/* Botão Tema (Sidebar) */
.sidebar-header {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    color: #fff;
    font-size: 1.3rem;
    margin: 0;
}

.theme-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.theme-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

.theme-btn svg {
    width: 22px;
    height: 22px;
}

.sun-icon { display: none; }
.moon-icon { display: block; }
[data-theme="dark"] .sun-icon { display: block; color: var(--accent-color); }
[data-theme="dark"] .moon-icon { display: none; }

/* Mobile Menu Button & Overlay */
#mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.6rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

#mobile-menu-btn svg {
    width: 24px;
    height: 24px;
}

#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    z-index: 90;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

/* Sidebar Interno */
.sidebar-nav {
    flex: 1;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.nav-link:hover {
    background-color: var(--primary-light);
    color: #fff;
}

.nav-link.active {
    background-color: var(--primary-light);
    color: var(--accent-color);
    border-left: 4px solid var(--accent-color);
}

.sidebar-footer {
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.social-links a {
    color: rgba(255,255,255,0.7);
    transition: color 0.2s;
    display: flex;
}

.social-links a:hover {
    color: var(--accent-color);
}

.social-links svg {
    width: 24px;
    height: 24px;
}

/* Seções (SPA) */
.page-section {
    display: none;
}

.page-section.active {
    display: block;
    animation: simpleFadeIn 0.4s ease forwards;
}

@keyframes simpleFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.section-header {
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Hero Section */
.hero {
    display: flex;
    align-items: flex-start;
    gap: 3rem;
    background: var(--surface-color);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.hero-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-color);
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.hero-text h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

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

.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: background-color var(--transition-speed);
}

.stat-num {
    display: block;
    font-size: 2rem;
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

[data-theme="dark"] .stat-num {
    color: var(--accent-color);
}

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

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Botões */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

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

[data-theme="dark"] .btn-primary {
    background-color: var(--primary-light);
}

.btn-primary:hover:not(.btn-disabled) {
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

[data-theme="dark"] .btn-primary:hover:not(.btn-disabled) {
    background-color: #2a5a8c;
}

.btn-outline {
    background-color: transparent;
    color: var(--text-main);
    border-color: var(--primary-color);
}

[data-theme="dark"] .btn-outline {
    border-color: var(--text-main);
}

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

[data-theme="dark"] .btn-outline:hover {
    background-color: var(--text-main);
    color: var(--bg-color);
}

.btn-accent {
    background-color: var(--accent-color);
    color: #1a1a1a;
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Estado de Botão Desabilitado */
.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Filtros e Busca */
.filters-container {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    max-width: 800px;
}

.search-container {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.filter-select-container {
    min-width: 180px;
    flex-shrink: 0;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-light);
    pointer-events: none;
}

#search-tcc, #filter-semester {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    background-color: var(--surface-color);
    color: var(--text-main);
    transition: border-color 0.2s, box-shadow 0.2s, background-color var(--transition-speed);
}

#search-tcc {
    padding-left: 3rem;
}

#search-tcc:focus, #filter-semester:focus {
    border-color: var(--primary-color);
}

[data-theme="dark"] #search-tcc:focus, 
[data-theme="dark"] #filter-semester:focus {
    border-color: var(--accent-color);
}

#filter-semester {
    cursor: pointer;
}

/* Grids e Cards */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s, background-color var(--transition-speed);
    display: flex;
    flex-direction: column;
}

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

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

.card-title {
    font-size: 1.15rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.card-meta {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-ano {
    background: var(--bg-color);
    color: var(--text-main);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
}

.card-desc {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.card-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    flex-wrap: wrap;
}

.w-100 {
    width: 100%;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px dashed var(--border-color);
}

.empty-state.hidden {
    display: none;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    color: var(--text-light);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.empty-state p {
    color: var(--text-light);
}

/* Breakpoints (Responsividade) */

/* Large Desktops */
@media (min-width: 1440px) {
    #content {
        padding: 4rem 6rem;
    }
    .hero {
        padding: 4rem;
    }
}

/* Tablets & Small Desktops */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .stats-container {
        justify-content: center;
    }
    .hero-actions {
        justify-content: center;
    }
    .section-header h2 {
        font-size: 2rem;
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 260px;
    }

    #sidebar {
        transform: translateX(-100%);
    }

    #sidebar.open {
        transform: translateX(0);
    }

    #content {
        margin-left: 0;
        width: 100%;
        padding: 5rem 1.5rem 2rem 1.5rem;
    }

    #mobile-menu-btn {
        display: block;
    }

    #overlay.show {
        display: block;
        opacity: 1;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .filters-container {
        flex-direction: column;
    }

    .filter-select-container {
        width: 100%;
    }

    .grid-container {
        grid-template-columns: 1fr;
    }
    
    .hero {
        padding: 2rem 1.5rem;
    }
}

/* Small Mobile (360px) */
@media (max-width: 360px) {
    .hero-text h1 {
        font-size: 1.8rem;
    }
    
    .hero-img {
        width: 150px;
        height: 150px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .card-actions {
        flex-direction: column;
    }

    .card-actions .btn {
        width: 100%;
    }

    #content {
        padding: 4.5rem 1rem 2rem 1rem;
    }
}