/**
 * Biblia em Contexto - Stylesheet
 * Desenvolvido por B20 Conteúdo Digital
 * https://www.b20.com.br
 */

/* ==================== CSS VARIABLES ==================== */
/* ==================== CSS VARIABLES ==================== */
:root {
    /* Paleta Premium - Baseada em Ouro e Púrpura */
    --primary-color: #6a1b9a;
    /* Deep Royal Purple */
    --secondary-color: #d4af37;
    /* Metallic Gold */
    --accent-color: #00897b;
    /* Teal */
    --surface-color: #f3e5f5;
    /* Light Purple Surface */
    --text-color: #2c3e50;
    /* Deep Blue-Gray */

    /* Variações */
    --primary-hover: #4a148c;
    --primary-light: #f3e5f5;
    /* Very light purple */
    --secondary-hover: #b4941f;
    /* Darker Gold */

    /* Functional Colors */
    --bg-color: #ffffff;
    --bg-secondary: #f8f9fa;
    /* Off-white */
    --bg-tertiary: #e9ecef;

    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #757575;

    --border-color: #e0e0e0;
    --border-hover: #bdbdbd;

    /* Shadows - Softer and more layered */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);

    /* Layout */
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --border-radius-lg: 24px;
    --spacing-unit: 8px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --header-height: 70px;
    --bottom-nav-height: 70px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-base: 16px;
    --font-size-sm: 14px;
    --font-size-lg: 18px;
    --font-size-xl: 24px;
    --font-size-2xl: 32px;
    --line-height-base: 1.6;
    --line-height-tight: 1.3;
}

/* Dark Mode */
body.dark-mode {
    --primary-color: #9c27b0;
    /* Lighter Purple for dark mode */
    --primary-light: #2d1b36;
    /* Dark purple background */
    --secondary-color: #ffd700;
    /* Bright Gold */

    --bg-color: #121212;
    /* True Dark */
    --bg-secondary: #1e1e1e;
    /* Card background */
    --bg-tertiary: #2c2c2c;

    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #757575;

    --border-color: #333333;
    --border-hover: #444444;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: clamp(14px, 2.5vw, 18px);
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-primary);
    background-color: var(--bg-color);
    padding-top: var(--header-height);
    padding-bottom: var(--bottom-nav-height);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }
}

/* ==================== TYPOGRAPHY ==================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: var(--line-height-tight);
    margin-bottom: calc(var(--spacing-unit) * 2);
    color: var(--text-primary);
}

h1 {
    font-size: var(--font-size-2xl);
}

h2 {
    font-size: var(--font-size-xl);
}

h3 {
    font-size: var(--font-size-lg);
}

p {
    margin-bottom: calc(var(--spacing-unit) * 2);
    color: var(--text-secondary);
}

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

a:hover {
    color: var(--primary-hover);
}

a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ==================== HEADER ==================== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 calc(var(--spacing-unit) * 2);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Header Logo styles moved to section below */

.desktop-nav {
    display: none;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
        gap: calc(var(--spacing-unit));
    }

    .desktop-nav .nav-link {
        padding: calc(var(--spacing-unit)) calc(var(--spacing-unit) * 2);
        border-radius: var(--border-radius-sm);
        color: var(--text-primary);
        font-weight: 500;
        transition: var(--transition);
        white-space: nowrap;
    }

    .desktop-nav .nav-link:hover,
    .desktop-nav .nav-link.active {
        background: var(--primary-color);
        color: white;
    }

    .desktop-nav .nav-link:focus-visible {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}

.header-actions {
    display: flex;
    gap: calc(var(--spacing-unit));
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: calc(var(--spacing-unit));
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 3);
    font-size: var(--font-size-base);
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    min-height: 44px;
    min-width: 44px;
}

.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

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

.btn-small {
    padding: calc(var(--spacing-unit)) calc(var(--spacing-unit) * 2);
    font-size: var(--font-size-sm);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-secondary);
}

.btn-icon:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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

/* ==================== CONTAINER ==================== */
.container {
    width: 100%;
    max-width: 100%;
    padding: calc(var(--spacing-unit) * 2);
    margin: 0 auto;
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
        padding: calc(var(--spacing-unit) * 3);
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1200px;
    }
}

/* ==================== SECTIONS ==================== */
.section {
    display: none;
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
    padding-bottom: calc(var(--spacing-unit) * 4);
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: calc(var(--spacing-unit) * 3);
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit) * 2);
}

.section-header h2 {
    margin: 0;
}

/* ==================== HERO SECTION ==================== */
/* Header Logo */
.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo img {
    height: 40px;
    width: auto;
}

.header-logo h1 {
    font-size: var(--font-size-lg);
    margin: 0;
    color: var(--primary-color);
}

@media (max-width: 480px) {
    .header-logo h1 {
        font-size: 1.1rem;
    }
}

/* ==================== HERO SECTION ==================== */
.hero-section {
    text-align: center;
    padding: calc(var(--spacing-unit) * 6) calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 4);
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.7)), url('../assets/images/hero.png');
    background-size: cover;
    background-position: center;
    color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(74, 21, 75, 0.4), rgba(212, 175, 55, 0.2));
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(32px, 5vw, 56px);
    color: white;
    margin-bottom: calc(var(--spacing-unit) * 2);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 800;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: calc(var(--spacing-unit) * 4);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.quick-actions {
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
    justify-content: center;
    flex-wrap: wrap;
}

.quick-actions .btn-primary {
    background: var(--secondary-color);
    color: #333;
    font-weight: bold;
}

.quick-actions .btn-primary:hover {
    background: white;
    transform: translateY(-2px);
}

.quick-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.quick-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

/* ==================== FEATURES GRID ==================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: calc(var(--spacing-unit) * 3);
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.feature-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 3);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto calc(var(--spacing-unit) * 2);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: 50%;
    color: var(--primary-color);
    font-size: 28px;
}

.feature-card h3 {
    font-size: var(--font-size-lg);
    margin-bottom: calc(var(--spacing-unit));
}

.feature-card p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
}

/* ==================== RECENT ACTIVITY ==================== */
.recent-activity {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 3);
}

.recent-activity h3 {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
}

.activity-item {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
    padding: calc(var(--spacing-unit) * 2);
    background: var(--bg-color);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.activity-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.activity-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: 50%;
    color: var(--primary-color);
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.activity-time {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* ==================== BIBLE SELECTOR ==================== */
.bible-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.selector-group {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit));
}

.selector-group label {
    font-weight: 500;
    color: var(--text-primary);
}

.form-select,
.form-input,
.form-textarea {
    width: 100%;
    padding: calc(var(--spacing-unit) * 1.5);
    font-size: var(--font-size-base);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-color);
    color: var(--text-primary);
    transition: var(--transition);
    min-height: 44px;
}

.form-select:focus,
.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
    resize: vertical;
    font-family: var(--font-family);
}

/* ==================== CONTEXT CARD ==================== */
.context-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 3);
    margin-bottom: calc(var(--spacing-unit) * 3);
    box-shadow: var(--shadow-sm);
}

.context-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.context-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit));
    color: var(--primary-color);
}

.context-content {
    color: var(--text-primary);
}

.context-content p {
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.context-content strong {
    color: var(--primary-color);
}

/* ==================== READING AREA ==================== */
.chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: calc(var(--spacing-unit) * 3);
    padding-bottom: calc(var(--spacing-unit));
    border-bottom: 2px solid var(--border-color);
}

.chapter-header h2 {
    margin: 0;
}

.chapter-favorite {
    font-size: 1.5rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.chapter-favorite:hover {
    background-color: var(--bg-secondary);
    color: var(--secondary-color);
}

.chapter-favorite .fas {
    color: var(--secondary-color);
}

.reading-area {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 3);
    min-height: 400px;
}

.reading-controls {
    display: flex;
    gap: calc(var(--spacing-unit));
}

.verse {
    margin-bottom: calc(var(--spacing-unit) * 2);
    padding: calc(var(--spacing-unit) * 1.5);
    padding-right: 48px;
    /* Space for favorite star */
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.verse:hover {
    background: var(--bg-secondary);
}

.verse-number {
    display: inline-block;
    font-weight: 600;
    color: var(--primary-color);
    margin-right: calc(var(--spacing-unit));
    min-width: 32px;
}

.verse-text {
    display: inline;
    line-height: 1.8;
}

.verse.favorited {
    background: var(--primary-light);
    border-left: 3px solid var(--primary-color);
}

.verse-favorite {
    position: absolute;
    right: calc(var(--spacing-unit));
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.2;
    /* Show faintly by default */
    transition: var(--transition);
    color: var(--text-muted);
    /* Ensure it has a color */
}

.verse:hover .verse-favorite,
.verse.favorited .verse-favorite {
    opacity: 1;
    color: var(--secondary-color);
    /* Highlight on hover/active */
}

/* ==================== TIMELINE ==================== */
.timeline-filters {
    display: flex;
    gap: calc(var(--spacing-unit));
    flex-wrap: wrap;
}

.timeline-container {
    position: relative;
    padding-left: calc(var(--spacing-unit) * 4);
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    opacity: 0.3;
}

.timeline-item {
    position: relative;
    margin-bottom: calc(var(--spacing-unit) * 5);
    padding-left: calc(var(--spacing-unit) * 3);
}

.timeline-marker {
    position: absolute;
    left: -35px;
    top: 5px;
    width: 18px;
    height: 18px;
    background: var(--bg-color);
    border: 4px solid var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(106, 27, 154, 0.2);
    z-index: 2;
    transition: var(--transition);
}

.timeline-item:hover .timeline-marker {
    background: var(--secondary-color);
    transform: scale(1.2);
    box-shadow: 0 0 10px var(--secondary-color);
}

.timeline-content {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 3);
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.timeline-content:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.timeline-date {
    display: inline-block;
    padding: 6px 16px;
    background: var(--primary-color);
    color: white;
    border-radius: 50px;
    font-size: var(--font-size-sm);
    font-weight: 700;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.5px;
}

.timeline-content h3 {
    margin-bottom: calc(var(--spacing-unit));
    color: var(--primary-color);
}

.timeline-content p {
    margin-bottom: calc(var(--spacing-unit) * 2);
    line-height: 1.6;
}

.timeline-books {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit));
}

.book-tag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.book-tag:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    background: var(--bg-color);
}

/* ==================== CHARACTERS ==================== */
.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: calc(var(--spacing-unit) * 1.5);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    padding-left: calc(var(--spacing-unit) * 5);
}

.search-results-info {
    margin-bottom: calc(var(--spacing-unit) * 2);
    color: var(--text-muted);
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: calc(var(--spacing-unit) * 3);
}

.character-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 3);
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: var(--transition);
}

.character-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.character-card:hover::before {
    opacity: 1;
}

.character-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto calc(var(--spacing-unit) * 2);
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 3px solid var(--primary-light);
    transition: var(--transition);
}

.character-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.character-card:hover .character-avatar {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.character-card:hover .character-avatar img {
    transform: scale(1.1);
}

/* Modal Character Details */
.character-detail {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 3);
}

.character-detail-header {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 3);
    padding-bottom: calc(var(--spacing-unit) * 3);
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to right, var(--bg-secondary), transparent);
    padding: calc(var(--spacing-unit) * 3);
    border-radius: var(--border-radius);
    margin: calc(var(--spacing-unit) * -1);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.character-avatar-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary-color);
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
    background: var(--bg-color);
}

.character-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-detail-header h2 {
    margin: 0 0 calc(var(--spacing-unit)) 0;
    color: var(--primary-color);
    font-size: var(--font-size-2xl);
}

.character-detail-body h3 {
    margin-top: calc(var(--spacing-unit) * 3);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit));
}

.character-detail-body h3::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.character-detail-body ul {
    list-style-type: none;
    padding: 0;
}

.character-detail-body li {
    padding: calc(var(--spacing-unit)) 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    line-height: 1.6;
}

.character-detail-body li::before {
    content: '•';
    color: var(--primary-color);
    font-weight: bold;
    margin-right: calc(var(--spacing-unit));
    font-size: 1.2em;
    line-height: 1;
}

@media (max-width: 600px) {
    .character-detail-header {
        flex-direction: column;
        text-align: center;
        padding: calc(var(--spacing-unit) * 2);
    }

    .character-avatar-large {
        width: 120px;
        height: 120px;
        margin-bottom: calc(var(--spacing-unit));
    }
}

.character-card h3 {
    margin-bottom: calc(var(--spacing-unit));
}

.character-role {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.character-period {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

/* ==================== FAVORITES ==================== */
.favorites-tabs {
    display: flex;
    gap: calc(var(--spacing-unit));
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: -2px;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.favorites-content {
    margin-top: calc(var(--spacing-unit) * 3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
}

.favorite-item {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 2);
    transition: var(--transition);
}

.favorite-item:hover {
    box-shadow: var(--shadow-sm);
}

.favorite-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: calc(var(--spacing-unit));
}

.favorite-reference {
    font-weight: 600;
    color: var(--primary-color);
}

.favorite-text {
    color: var(--text-secondary);
    line-height: 1.6;
}

.notes-header {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
}

.note-item {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 2);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: calc(var(--spacing-unit));
}

.note-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.note-reference {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.note-content {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: calc(var(--spacing-unit));
}

.note-date {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.note-actions {
    display: flex;
    gap: calc(var(--spacing-unit));
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: calc(var(--spacing-unit) * 6) calc(var(--spacing-unit) * 2);
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: calc(var(--spacing-unit) * 2);
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: calc(var(--spacing-unit));
}

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

/* ==================== MODALS ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    padding: calc(var(--spacing-unit) * 2);
    overflow-y: auto;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-large {
    max-width: 800px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(var(--spacing-unit) * 3);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
}

.modal-body {
    padding: calc(var(--spacing-unit) * 3);
    overflow-y: auto;
    flex-grow: 1;
}

.modal-close {
    color: var(--text-muted);
}

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

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.form-group label {
    display: block;
    margin-bottom: calc(var(--spacing-unit));
    font-weight: 500;
    color: var(--text-primary);
}

.form-actions {
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
    justify-content: flex-end;
    margin-top: calc(var(--spacing-unit) * 3);
}

.search-input-group {
    position: relative;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.search-input-group i {
    position: absolute;
    left: calc(var(--spacing-unit) * 1.5);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input-group input {
    padding-left: calc(var(--spacing-unit) * 5);
}

.search-filters {
    display: flex;
    gap: calc(var(--spacing-unit));
    margin-bottom: calc(var(--spacing-unit) * 2);
    flex-wrap: wrap;
}

.filter-btn {
    padding: calc(var(--spacing-unit)) calc(var(--spacing-unit) * 2);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: var(--transition);
}

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

.filter-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

/* ==================== BOTTOM NAVIGATION ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: calc(var(--spacing-unit)) calc(var(--spacing-unit) * 2);
    color: var(--text-muted);
    font-size: 11px;
    transition: var(--transition);
    min-width: 64px;
    min-height: 48px;
    text-decoration: none;
}

.nav-item i {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active i {
    transform: scale(1.15);
}

.nav-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none !important;
    }
}

/* ==================== SEARCH RESULTS ==================== */
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1.5);
}

.search-category-title {
    margin: calc(var(--spacing-unit) * 2) 0 calc(var(--spacing-unit));
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-result-item {
    padding: calc(var(--spacing-unit) * 2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-item:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.search-result-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.search-result-content h4 {
    margin: 0;
    font-size: var(--font-size-base);
    color: var(--text-primary);
}

.search-result-content p {
    margin: 4px 0 0;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.search-result-item .action-icon {
    color: var(--text-muted);
    font-size: 14px;
}

/* ==================== TOAST ==================== */
.toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + calc(var(--spacing-unit) * 2));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: var(--bg-color);
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 3);
    border-radius: var(--border-radius-sm);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 3000;
    max-width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@media (min-width: 768px) {
    .toast {
        bottom: calc(var(--spacing-unit) * 2);
    }
}

/* ==================== FOOTER ==================== */
.app-footer {
    background: var(--bg-secondary);
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 2);
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: calc(var(--spacing-unit) * 6);
}

.footer-content p {
    margin-bottom: calc(var(--spacing-unit));
    color: var(--text-secondary);
}

.b20-link {
    color: var(--primary-color);
    font-weight: 600;
    transition: var(--transition);
}

.b20-link:hover {
    text-decoration: underline;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: calc(var(--spacing-unit));
    flex-wrap: wrap;
    margin-top: calc(var(--spacing-unit) * 2);
}

.footer-links a {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-links span {
    color: var(--text-muted);
}

/* ==================== UTILITY CLASSES ==================== */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==================== LOADING SKELETON ==================== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-color) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ==================== CHARACTER MODAL HEADER ==================== */
.modal-character-header {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.5);
}

.modal-character-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.modal-character-info {
    display: flex;
    flex-direction: column;
}

.modal-character-name {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.modal-character-role {
    font-size: var(--font-size-sm);
    color: var(--primary-color);
}

.character-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: calc(var(--spacing-unit));
    margin-bottom: calc(var(--spacing-unit) * 2);
    background: var(--bg-secondary);
    padding: calc(var(--spacing-unit));
    border-radius: var(--border-radius-sm);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.meta-item i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.highlights-list {
    list-style: none;
    padding: 0;
}

.highlights-list li {
    position: relative;
    padding-left: 0;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--text-secondary);
}

.highlights-list li i {
    color: var(--secondary-color);
    margin-top: 4px;
    flex-shrink: 0;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==================== SHARE SECTION ==================== */
.share-section {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 3);
    margin-bottom: calc(var(--spacing-unit) * 4);
    text-align: center;
    border: 1px solid var(--border-color);
}

.share-content h3 {
    margin-bottom: calc(var(--spacing-unit));
    color: var(--primary-color);
}

.share-content p {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.share-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
}

.social-buttons {
    display: flex;
    gap: calc(var(--spacing-unit));
    flex-wrap: wrap;
    justify-content: center;
}

.btn-social {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.25rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.btn-whatsapp {
    background-color: #25D366;
}

.btn-facebook {
    background-color: #1877F2;
}

.btn-twitter {
    background-color: #000000;
}

.btn-telegram {
    background-color: #0088cc;
}

.copy-link-wrapper {
    display: flex;
    max-width: 400px;
    width: 100%;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 4px;
}

.share-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    padding: 8px 12px;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    outline: none;
    width: 100%;
}

.copy-link-wrapper .btn-icon {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    color: var(--primary-color);
    width: 36px;
    height: 36px;
}

.copy-link-wrapper .btn-icon:hover {
    background: var(--primary-color);
    color: white;
}

/* ==================== PRINT STYLES ==================== */
@media print {

    .app-header,
    .bottom-nav,
    .app-footer,
    .btn,
    .modal {
        display: none !important;
    }

    body {
        padding: 0;
    }

    .section {
        display: block !important;
    }
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}