/* ===== THEME SYSTEM ===== */
:root {
    /* Light Theme (Default) */
    --primary-color: #2196F3;
    --secondary-color: #1976D2;
    --accent-color: #FFC107;
    --danger-color: #dc3545;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --purple-color: #9C27B0;
    
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --border-color: #e9ecef;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 25px rgba(0,0,0,0.12);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Logo and branding */
    --logo-size: 60px;
    --header-height: 80px;
}

/* Dark Theme */
[data-theme="dark"] {
    --primary-color: #64B5F6;
    --secondary-color: #42A5F5;
    --accent-color: #FFD54F;
    --danger-color: #EF5350;
    --success-color: #66BB6A;
    --warning-color: #FFB74D;
    --info-color: #4FC3F7;
    --purple-color: #BA68C8;
    
    --background-color: #1a1a1a;
    --card-background: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
    --shadow-hover: 0 8px 25px rgba(0,0,0,0.4);
}

/* Blue Theme */
[data-theme="blue"] {
    --primary-color: #1976D2;
    --secondary-color: #1565C0;
    --accent-color: #FF9800;
    --danger-color: #D32F2F;
    --success-color: #388E3C;
    --warning-color: #F57C00;
    --info-color: #0288D1;
    --purple-color: #7B1FA2;
    
    --background-color: #E3F2FD;
    --card-background: #ffffff;
    --text-primary: #1a237e;
    --text-secondary: #3949ab;
    --border-color: #BBDEFB;
    --shadow: 0 2px 12px rgba(25, 118, 210, 0.1);
    --shadow-hover: 0 8px 25px rgba(25, 118, 210, 0.15);
}

/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    margin-bottom: 140px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    padding-bottom: 140px; /* Espaço para footer fixo + bottom nav */
}

/* ===== HEADER ===== */
.app-header {
    background: var(--card-background);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    min-width: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo {
    width: var(--logo-size);
    height: var(--logo-size);
    border-radius: 8px;
    object-fit: contain;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.05);
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.header-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===== THEME SELECTOR ===== */
.theme-selector {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-btn {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

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

.theme-icon {
    font-size: 1rem;
}

.theme-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 0.5rem;
    min-width: 150px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
}

.theme-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
    color: var(--text-primary);
}

.theme-option:hover {
    background: var(--background-color);
}

.theme-option.active {
    background: var(--primary-color);
    color: white;
}

.theme-preview {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===== NAVIGATION ===== */
.bottom-nav {
    background: var(--card-background);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
}

.bottom-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 12px;
    transition: var(--transition);
    min-width: 60px;
    flex: 1;
    max-width: 100px;
    position: relative;
}

.nav-item:hover {
    color: var(--primary-color);
    background: var(--background-color);
    transform: translateY(-2px);
}

.nav-item.active {
    color: white;
    background: var(--primary-color);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
}

.nav-item i {
    font-size: 1.25rem;
    transition: var(--transition);
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}

/* ===== CONTENT SECTIONS ===== */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

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

.section-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header h2 i {
    color: var(--primary-color);
    font-size: 1.8rem;
}

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

/* ===== CARDS ===== */
.welcome-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

/* Home section specific styles */
#home .section-header {
    text-align: center;
    justify-content: center;
}

#home .section-header h2 {
    justify-content: center;
}

.recent-articles {
    margin-top: 3rem;
}

.recent-articles h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.welcome-card h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.welcome-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.quick-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.action-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: var(--transition);
}

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

.action-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.3);
}

.action-btn:active {
    transform: translateY(-1px);
}

.action-btn.secondary {
    background: var(--card-background);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.action-btn.secondary:hover {
    background: var(--background-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* Modern plus icon for action buttons */
.action-btn i.fas.fa-plus {
    position: relative;
    width: 16px;
    height: 16px;
}

.action-btn i.fas.fa-plus::before {
    content: '';
    position: absolute;
    width: 2px;
    height: 16px;
    background: currentColor;
    border-radius: 1px;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.action-btn i.fas.fa-plus::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* ===== GRIDS ===== */
.articles-grid, .notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

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

.article-card, .note-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.article-card::before, .note-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: var(--transition);
}

.article-card:hover::before {
    transform: scaleX(1);
}

.note-card::before {
    background: linear-gradient(90deg, var(--success-color), var(--info-color));
}

.note-card:hover::before {
    transform: scaleX(1);
}

.article-card:hover, .note-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* Article card specific styles */
.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.article-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    flex: 1;
}

.article-author {
    color: var(--text-primary);
    font-weight: 500;
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
}

.article-year {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
    font-weight: 500;
}

.article-favorite {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    padding: 0.25rem;
    border-radius: 50%;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-favorite:hover {
    color: var(--accent-color);
    background: rgba(255, 193, 7, 0.1);
    transform: scale(1.1);
}

.article-favorite.active {
    color: var(--accent-color);
    animation: favoritePulse 0.3s ease;
}

@keyframes favoritePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Loading animation for articles */
.articles-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

.articles-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Article card entrance animation */
.article-card {
    animation: cardEntrance 0.5s ease-out;
}

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

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

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.card-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.article-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.keyword-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.keyword-tag:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.article-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-small {
    background: var(--background-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    font-weight: 500;
    min-height: 36px;
    min-width: 80px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-small::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: var(--transition);
}

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

.btn-small:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

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

.btn-small.primary:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

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

.btn-small.danger:hover {
    background: #c82333;
    border-color: #c82333;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-small:active {
    transform: translateY(0);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group label.required::after {
    content: ' *';
    color: var(--danger-color);
    font-weight: 700;
}

.form-group label i {
    color: var(--primary-color);
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

.field-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-background);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Estilos específicos para textarea de notas */
.note-form textarea {
    resize: vertical;
    min-height: 200px;
    font-family: inherit;
    line-height: 1.5;
}

.note-form textarea:focus {
    min-height: 250px;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-background);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.form-info {
    text-align: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.form-info small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.form-info i {
    color: var(--info-color);
    margin-right: 0.25rem;
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-secondary {
    background: var(--card-background);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: var(--background-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-icon {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-icon::before {
    content: '';
    position: absolute;
    width: 3px;
    height: 18px;
    background: currentColor;
    border-radius: 2px;
    transition: var(--transition);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}

.btn-icon::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 3px;
    background: currentColor;
    border-radius: 2px;
    transition: var(--transition);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}

.btn-icon:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.btn-icon:hover::before {
    transform: scale(1.1);
}

.btn-icon:hover::after {
    transform: scale(1.1);
}

.btn-icon:active {
    transform: scale(0.95);
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    backdrop-filter: blur(8px);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

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

.modal-content {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-hover);
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger-color);
}

/* ===== SEARCH ===== */
.search-container {
    margin-bottom: 2rem;
}

.search-filters {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: linear-gradient(135deg, #6a11cb, #2575fc); /* violeta para azul */
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: white;
    max-width: 600px;
    margin: auto;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
    padding-bottom: 80px;
}

.modal-content {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 0;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

/* Modal específico para artigos */
.article-modal-content {
    max-width: 600px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.article-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-bottom: 30px;
}

.form-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.5rem;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 1rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.section-title i {
    color: var(--primary-color);
    font-size: 1rem;
}

/* Modal específico para notas */
.note-modal-content {
    max-width: 700px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.note-form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.modal.active .modal-content {
    transform: scale(1);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
    transform: scale(1.1);
}

.search-box {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    transition: background 0.3s ease;
}

.search-box i {
    margin-right: 0.75rem;
    color: white;
    font-size: 1.1rem;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 1rem;
    caret-color: #fff;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.filter-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tag {
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 2rem;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.filter-tag:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.filter-tag.active {
    background-color: white;
    color: #6a11cb;
    font-weight: bold;
}

.filter-tags {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.filter-tag {
    background: var(--background-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.filter-tag::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: var(--transition);
}

.filter-tag:hover::before {
    left: 100%;
}

.filter-tag:hover,
.filter-tag.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.filter-tag.active::before {
    display: none;
}

/* ===== BIBLIOGRAPHY ===== */
.bibliography-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.bibliography-actions select {
    min-width: 200px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-background);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.bibliography-output {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    min-height: 300px;
    border: 1px solid var(--border-color);
    margin-top: 2rem;
}

/* ===== FAQ ===== */
.faq-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

/* FAQ Header */
.faq-header {
    margin-bottom: 2rem;
}

.faq-search {
    margin-bottom: 1.5rem;
}

.faq-search .search-box {
    max-width: 500px;
    margin: 0 auto;
}

.faq-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
}

.category-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.category-btn i {
    font-size: 0.8rem;
}

/* FAQ Content */
.faq-content {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item:hover {
    background: rgba(33, 150, 243, 0.02);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.faq-question:hover {
    background: rgba(33, 150, 243, 0.05);
}

.faq-question-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.faq-question-content i {
    color: var(--primary-color);
    font-size: 1.2rem;
    min-width: 1.2rem;
}

.faq-question span {
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.faq-toggle {
    color: var(--text-secondary);
    transition: var(--transition);
    font-size: 0.9rem;
}

.faq-answer {
    display: none;
    padding: 0 1.5rem 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
    border-top: 1px solid var(--border-color);
    margin: 0 1.5rem;
}

.faq-answer p {
    margin-bottom: 1rem;
}

.faq-answer ul, .faq-answer ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.faq-answer li {
    margin-bottom: 0.5rem;
}

.faq-answer strong {
    color: var(--text-primary);
    font-weight: 600;
}

.bibliography-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.bibliography-header h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.bibliography-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.bibliography-item {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.bibliography-item:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

/* ===== STATES ===== */
.empty-state, .error-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    background: var(--card-background);
    border-radius: var(--border-radius);
    border: 2px dashed var(--border-color);
    margin: 2rem 0;
}

.empty-state i, .error-state i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.4;
    color: var(--primary-color);
}

.empty-state p, .error-state p {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 500;
}

.empty-state small, .error-state small {
    font-size: 1rem;
    opacity: 0.8;
    line-height: 1.5;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-background);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10000;
    animation: toastSlideIn 0.3s ease;
    border: 1px solid var(--border-color);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success { border-left: 4px solid var(--success-color); }
.toast-error { border-left: 4px solid var(--danger-color); }
.toast-info { border-left: 4px solid var(--info-color); }

.toast i { color: var(--success-color); }
.toast-error i { color: var(--danger-color); }
.toast-info i { color: var(--info-color); }

/* ===== NOTE STYLES ===== */
.note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.note-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

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

.note-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ===== FOOTER ===== */
footer {
    background: var(--card-background);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 4rem;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.footer-links a:hover {
    color: var(--secondary-color);
    background: var(--background-color);
    text-decoration: none;
}

.footer-links .separator {
    color: var(--text-secondary);
    font-weight: 300;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .app-header {
        padding: 1rem;
        min-height: auto;
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-content {
        flex-direction: row;
        gap: 1rem;
        align-items: center;
        justify-content: space-between;
    }
    
    .header-stats {
        font-size: 0.8rem;
    }
    
    .theme-selector {
        align-self: flex-end;
    }
    
    .quick-actions {
        gap: 0.5rem;
    }
    
    .articles-grid, .notes-grid {
        gap: 1rem;
    }
    
    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .section-header {
        padding: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .section-header h2 i {
        font-size: 1.4rem;
    }
    
    .article-card {
        padding: 1.25rem;
    }
    
    .article-title {
        font-size: 1.1rem;
    }
    
    .article-favorite {
        font-size: 1.3rem;
        min-width: 40px;
        min-height: 40px;
    }
    
    .btn-small {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        min-height: 32px;
        min-width: 70px;
    }
    
    .empty-state {
        padding: 3rem 1.5rem;
    }
    
    .empty-state i {
        font-size: 3rem;
    }
    
    .bibliography-actions {
        gap: 0.5rem;
        flex-direction: column;
        align-items: stretch;
    }
    
    .bibliography-actions select {
        min-width: auto;
    }
    
    .search-filters {
        padding: 0.75rem;
    }
    
    .search-input {
        padding: 0.75rem 0.75rem 0.75rem 2.25rem;
        font-size: 0.9rem;
    }
    
    .filter-tags {
        gap: 0.4rem;
        margin-top: 0.75rem;
    }
    
    .filter-tag {
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
    }
    
    .bottom-nav {
        padding: 0.4rem 0.25rem;
    }
    
    .nav-item {
        padding: 0.3rem 0.25rem;
        min-width: 45px;
        max-width: 70px;
        gap: 0.15rem;
    }
    
    .nav-item i {
        font-size: 1rem;
    }
    
    .nav-item span {
        font-size: 0.6rem;
    }
    
    footer {
        padding: 1rem 0.5rem;
    }
    
    .footer-content {
        gap: 0.5rem;
    }
    
    .footer-content p {
        font-size: 0.8rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-links a {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }
    
    body {
        padding-bottom: 120px; /* Ajustado para footer fixo + bottom nav */
    }
    
    .btn-icon {
        width: 36px;
        height: 36px;
    }
    
    .btn-icon::before {
        width: 2px;
        height: 12px;
    }
    
    .btn-icon::after {
        width: 12px;
        height: 2px;
    }
    
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .welcome-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .article-card, .note-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .search-filters {
        padding: 1rem;
    }
    
    .search-input {
        padding: 0.875rem 0.875rem 0.875rem 2.5rem;
        font-size: 0.95rem;
    }
    
    .filter-tags {
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .filter-tag {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .btn-icon {
        width: 40px;
        height: 40px;
    }
    
    .btn-icon::before {
        width: 2px;
        height: 14px;
    }
    
    .btn-icon::after {
        width: 14px;
        height: 2px;
    }
    
    .bottom-nav {
        padding: 0.5rem 0.5rem;
    }
    
    .nav-item {
        padding: 0.4rem 0.5rem;
        min-width: 50px;
        max-width: 80px;
    }
    
    .nav-item i {
        font-size: 1.1rem;
    }
    
    .nav-item span {
        font-size: 0.65rem;
    }
    
    footer {
        padding: 1.5rem 1rem;
        margin-top: 3rem;
    }
    
    .footer-content {
        gap: 0.75rem;
    }
    
    .footer-content p {
        font-size: 0.85rem;
    }
    
    .footer-links {
        gap: 0.25rem;
    }
    
    .footer-links a {
        padding: 0.2rem 0.4rem;
        font-size: 0.85rem;
    }
    
    body {
        padding-bottom: 110px; /* Ajustado para footer fixo + bottom nav */
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 1.25rem;
    }
    
    .header-stats {
        font-size: 0.75rem;
    }
    
    .nav-item span {
        font-size: 0.7rem;
    }
    
    .nav-item i {
        font-size: 1.1rem;
    }
    
    .welcome-card h2 {
        font-size: 1.25rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .section-header h2 {
        justify-content: center;
    }
    
    .modal-content {
        margin: 0.5rem;
        padding: 1rem;
        border-radius: 8px;
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
        position: sticky;
        bottom: 0;
        background: var(--card-background);
        border-top: 1px solid var(--border-color);
        margin-top: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-actions button {
        width: 100%;
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .form-body {
        padding: 0 1rem;
    }
    
    .section-title {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .quick-actions {
        gap: 0.25rem;
    }
    
    .article-card, .note-card {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .welcome-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .section-header {
        padding: 0.75rem;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .section-header h2 {
        font-size: 1.25rem;
        justify-content: center;
    }
    
    .section-header h2 i {
        font-size: 1.2rem;
    }
    
    .article-card {
        padding: 1rem;
    }
    
    .article-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .article-favorite {
        align-self: flex-end;
        font-size: 1.2rem;
        min-width: 36px;
        min-height: 36px;
    }
    
    .article-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-small {
        width: 100%;
        justify-content: center;
        padding: 0.5rem;
        font-size: 0.85rem;
        min-height: 40px;
    }
    
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .empty-state i {
        font-size: 2.5rem;
    }
    
    .empty-state p {
        font-size: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .theme-selector {
        align-self: center;
    }
    
    .bibliography-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bibliography-actions select {
        min-width: auto;
    }
    
    /* FAQ Responsive */
    .faq-categories {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .category-btn {
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .faq-question span {
        font-size: 0.9rem;
    }
    
    /* FAQ Responsive */
    .faq-container {
        padding: 0.5rem;
    }
    
    .faq-categories {
        gap: 0.25rem;
    }
    
    .category-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .category-btn span {
        display: none;
    }
    
    .faq-question {
        padding: 1rem;
    }
    
    .faq-question-content {
        gap: 0.75rem;
    }
    
    .faq-question-content i {
        font-size: 1rem;
        min-width: 1rem;
    }
    
    .faq-answer {
        padding: 0 1rem 1rem;
        margin: 0 1rem;
    }
    
    .modal-content {
        margin: 0.25rem;
        padding: 0.75rem;
        max-height: 90vh;
        border-radius: 6px;
    }
    
    .form-actions {
        padding: 0.75rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-actions button {
        padding: 0.875rem;
        font-size: 0.95rem;
        width: 100%;
    }
    
    .form-body {
        padding: 0 0.75rem;
    }
    
    .form-section {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .section-title {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .field-hint {
        font-size: 0.75rem;
    }

    /* Estilos responsivos para modal de notas */
    .note-modal-content {
        max-width: 95%;
        max-height: 95vh;
    }

    .note-form textarea {
        min-height: 150px;
    }

    .note-form textarea:focus {
        min-height: 180px;
    }
}

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

/* Focus styles for accessibility */
button:focus,
input:focus,
textarea:focus,
select:focus,
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Touch target sizes for mobile */
@media (max-width: 768px) {
    .btn-small {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-item {
        min-height: 60px;
    }
}

/* Safe area for mobile devices */
@supports (padding: max(0px)) {
    .app-header {
        padding-top: max(1rem, env(safe-area-inset-top));
    }
    
    .bottom-nav {
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    }
}
