/* OTAKAI DESIGN SYSTEM — BASE, HEADER, MODAIS, CARDS E RESPONSIVIDADE */
:root {
    --bg: #0c0d10;
    --bg-elevated: #14161c;
    --card-bg: #171921;
    --surface-alt: #1f222d;
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --accent: #ffb300;
    --accent-hover: #ffc433;
    --accent-soft: rgba(255, 179, 0, 0.14);
    --border: rgba(255, 255, 255, 0.08);
    --danger: #ef4444;
    --success: #22c55e;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

body.light-mode {
    --bg: #f5f6fa;
    --bg-elevated: #ffffff;
    --card-bg: #ffffff;
    --surface-alt: #eceff5;
    --text: #111827;
    --text-muted: #4b5563;
    --accent: #e68a00;
    --accent-hover: #cc7a00;
    --accent-soft: rgba(230, 138, 0, 0.12);
    --border: rgba(17, 24, 39, 0.1);
    --shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.25s ease, color 0.25s ease;
}

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

.hidden {
    display: none !important;
}

/* HEADER */
.site-header {
    background: rgba(20, 22, 28, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 68px;
    border-bottom: 1px solid var(--border);
}

body.light-mode .site-header {
    background: rgba(255, 255, 255, 0.88);
}

.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
    height: 100%;
    padding: 0 20px;
    gap: 16px;
}

.left-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 36px;
    width: auto;
    display: block;
}

.brand-text {
    font-weight: 900;
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.menu-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s;
}

.menu-link:hover,
.menu-link.active {
    color: var(--text);
    background: var(--surface-alt);
}

.menu-link.active {
    color: var(--accent);
}

.right-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-trigger {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    transition: border-color 0.2s, color 0.2s;
}

.search-trigger:hover {
    border-color: var(--accent);
    color: var(--text);
}

.search-kbd {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-family: inherit;
}

.icon-btn {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: border-color 0.2s, transform 0.15s;
}

.icon-btn:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.btn-auth-pill {
    background: var(--accent);
    color: #111;
    border: none;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, transform 0.15s;
}

.btn-auth-pill:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* USER DROPDOWN */
.user-menu-wrap {
    position: relative;
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.84rem;
}

.user-avatar-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: #111;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 220px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 8px;
    z-index: 200;
}

.user-dropdown-head {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-dropdown-head small {
    color: var(--text-muted);
    font-size: 0.74rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.user-dropdown-item:hover {
    background: var(--surface-alt);
}

.user-dropdown-item.danger {
    color: var(--danger);
}

/* BOTÕES E BADGES */
.btn-primary {
    background: var(--accent);
    color: #111;
    border: none;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, transform 0.15s;
}

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

.btn-secondary {
    background: var(--surface-alt);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: border-color 0.2s, background 0.2s;
}

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

.btn-full {
    width: 100%;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-type {
    background: var(--accent-soft);
    color: var(--accent);
}

.badge-status {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

/* CONTAINERS E TÍTULOS */
.page-container {
    max-width: 1280px;
    width: 100%;
    margin: 28px auto 60px;
    padding: 0 20px;
    flex: 1;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 28px 0 16px;
    gap: 12px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    border-radius: 4px;
    background: var(--accent);
    display: inline-block;
}

.section-more {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--accent);
}

/* GRID DE OBRAS */
.grid-obras {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 20px;
}

.card-obra {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.card-cover-wrap {
    position: relative;
    aspect-ratio: 3 / 4.2;
    overflow: hidden;
    background: var(--surface-alt);
}

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

.card-obra:hover .card-img {
    transform: scale(1.04);
}

.card-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
}

.card-rating-pill {
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    color: #fbbf24;
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 800;
}

.card-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.card-title {
    font-weight: 800;
    font-size: 0.92rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    margin-top: auto;
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* SEARCH OVERLAY */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.76);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 70px 16px 24px;
}

.search-modal {
    width: 100%;
    max-width: 640px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.search-modal-head {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.search-modal-head input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
}

.search-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.7rem;
    cursor: pointer;
    line-height: 1;
}

.search-results {
    max-height: 420px;
    overflow-y: auto;
    padding: 10px;
}

.search-hint {
    color: var(--text-muted);
    text-align: center;
    padding: 24px 12px;
    font-size: 0.9rem;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.search-item:hover {
    background: var(--surface-alt);
}

.search-item img {
    width: 46px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
}

.search-item-title {
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.search-item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* AUTH MODAL */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.76);
    backdrop-filter: blur(6px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.auth-modal-card {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    box-shadow: var(--shadow);
}

.auth-close-btn {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--surface-alt);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.auth-tab {
    flex: 1;
    padding: 9px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
}

.auth-tab.active {
    background: var(--accent);
    color: #111;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.auth-form input {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text);
    font-family: inherit;
    font-size: 0.94rem;
}

.auth-error {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
}

/* TOAST */
#otakai-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.otakai-toast {
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    font-size: 0.88rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s;
}

.otakai-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.otakai-toast-success { border-left-color: var(--success); }
.otakai-toast-error { border-left-color: var(--danger); }

/* FOOTER */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
    padding: 20px;
    margin-top: auto;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.84rem;
    color: var(--text-muted);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.footer-links {
    display: flex;
    gap: 16px;
}

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

/* 404 */
.page-404 {
    min-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 20px;
}

.code-404 {
    font-size: clamp(4rem, 12vw, 7rem);
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 8px;
}

@media (max-width: 720px) {
    .brand-text, .search-kbd, .search-label, .user-avatar-name {
        display: none;
    }
    .left-nav {
        gap: 12px;
    }
    .menu-link {
        padding: 6px 10px;
        font-size: 0.82rem;
    }
    .grid-obras {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
}
