/* ============================================================
   OTAKU REALM — Manga / Brutalist Aesthetic
   Mobile-First Responsive CSS  (v4.2)
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────────── */
:root {
    --black: #050505;
    --white: #fdfdfd;
    --gray-light: #e0e0e0;
    --gray-dark: #333333;
    --border-w: 4px;
    --shadow-offset: 8px;
    --font-main: 'Outfit', sans-serif;
    --font-jp: 'Noto Sans JP', sans-serif;
    --halftone: url('data:image/svg+xml;utf8,<svg width="4" height="4" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="%23000"/></svg>');
    --halftone-white: url('data:image/svg+xml;utf8,<svg width="4" height="4" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="%23fff"/></svg>');
    --accent: #ff0055;
}

/* ── Nav User Dropdown (manga theme) ─────────────────────────── */
.nav-user-menu { position: relative; display: inline-block; }
.nav-user-dropdown {
    display: none;
    flex-direction: column;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--white);
    border: var(--border-w) solid var(--black);
    min-width: 190px;
    z-index: 2000;
    box-shadow: 6px 6px 0 var(--black);
}
.nav-user-dropdown.open { display: flex; }
.nav-user-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.1rem;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    color: var(--black);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-main);
    border-bottom: 2px solid var(--black);
    transition: background 0.15s;
    width: 100%;
}
.nav-user-dropdown .dropdown-item:last-child { border-bottom: none; }
.nav-user-dropdown .dropdown-item:hover { background: var(--black);
    color: var(--white); }

/* Mobile fixes for user dropdown */
@media (max-width: 640px) {
    .nav-user-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        border-top: 2px solid var(--black);
        margin-top: 0.5rem;
        width: 100%;
        background: var(--gray-light);
    }
    .nav-user-dropdown .dropdown-item {
        padding: 1rem 1.1rem;
        border-bottom: 1px solid var(--gray-dark);
    }
}

/* ── Comment Section ────────────────────────────────────────────── */
.comment-form-wrap {
    border: 4px solid var(--black);
    background: var(--white);
    padding: 1.5rem;
    box-shadow: 6px 6px 0 var(--black);
    margin-bottom: 2rem;
}
.comment-form-wrap textarea {
    width: 100%;
    border: 3px solid var(--black);
    padding: 0.8rem 1rem;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    resize: vertical;
    background: var(--white);
    color: var(--black);
    box-sizing: border-box;
    transition: box-shadow 0.2s;
}
.comment-form-wrap textarea:focus {
    outline: none;
    box-shadow: 4px 4px 0 var(--black);
}
.comment-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.8rem;
}
.comment-login-prompt {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border: 3px dashed var(--black);
    margin-bottom: 2rem;
}
.comment-card {
    border: 3px solid var(--black);
    background: var(--white);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 4px 4px 0 var(--black);
    animation: commentIn 0.3s ease;
}
@keyframes commentIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.comment-author {
    font-weight: 900;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    background: var(--black);
    color: var(--black);
    padding: 0.15rem 0.5rem;
}
.comment-time {
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0.55;
    letter-spacing: 0.03em;
}
.comment-text {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.6;
    margin: 0;
    word-break: break-word;
}
body.dark-mode .comment-card { background: #1a1a1a; border-color: var(--gray-dark); }
body.dark-mode .comment-form-wrap { background: #1a1a1a; border-color: var(--gray-dark); }
body.dark-mode .comment-form-wrap textarea { background: #111; color: var(--black); border-color: var(--gray-dark); }

/* ── Profile Page ───────────────────────────────────────────────── */
.profile-card {
    border: 4px solid var(--black);
    background: var(--white);
    padding: 2.5rem;
    box-shadow: 8px 8px 0 var(--black);
    margin-bottom: 3rem;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex-wrap: wrap;
}
.profile-avatar {
    font-family: var(--font-jp);
    font-size: 2.5rem;
    width: 90px;
    height: 90px;
    border: 4px solid var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--black);
    color: var(--black);
    flex-shrink: 0;
    font-family: var(--font-main);
    font-weight: 900;
}
.profile-info h2 { font-size: 2rem; font-weight: 900; margin-bottom: 0.5rem; }
.profile-meta { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1rem; }
.profile-meta-item { font-size: 0.8rem; font-weight: 800; opacity: 0.7; letter-spacing: 0.05em; }
.profile-meta-item strong { display: block; font-size: 1rem; opacity: 1; color: var(--black); }
.comment-history-item {
    border: 3px solid var(--black);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1rem;
    background: var(--white);
    box-shadow: 3px 3px 0 var(--black);
}
.comment-history-item .page-tag {
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    background: var(--black);
    color: var(--black);
    padding: 0.1rem 0.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}
body.dark-mode .profile-card { background: #1a1a1a; }
body.dark-mode .comment-history-item { background: #1a1a1a; }
body.dark-mode .profile-meta-item strong { color: var(--black); }

/* ── Avatar Edit Grid ─────────────────────────────────────────── */
.avatar-selector-wrap {
    border: 4px solid var(--black);
    background: var(--white);
    padding: 1.5rem;
    margin-bottom: 3rem;
    box-shadow: 6px 6px 0 var(--black);
}
.avatar-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.preset-avatar-btn {
    width: 60px;
    height: 60px;
    font-size: 2rem;
    border: 3px solid var(--black);
    background: var(--white);
    cursor: pointer;
    box-shadow: 4px 4px 0 var(--black);
    transition: transform 0.1s, box-shadow 0.1s, background 0.15s;
    display: flex;
    justify-content: center;
    align-items: center;
}
.preset-avatar-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--black);
    background: var(--black);
}
body.dark-mode .avatar-selector-wrap {
    background: #1a1a1a;
    border-color: var(--gray-dark);
}
body.dark-mode .preset-avatar-btn {
    background: #111;
    border-color: var(--gray-dark);
}
body.dark-mode .preset-avatar-btn:hover {
    background: var(--white);
}

/* ============================================================
   COMMENT REPLIES UI
   ============================================================ */
.reply-toggle-btn {
    background: none;
    border: none;
    color: var(--black);
    font-family: var(--font-manga);
    font-weight: 800;
    font-size: 0.75rem;
    padding: 0;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
    text-transform: uppercase;
}
.reply-toggle-btn:hover {
    opacity: 1;
    transform: translateX(2px);
}

.view-replies-btn {
    background: none;
    border: none;
    color: var(--primary-color, #ff3b3b);
    font-family: var(--font-manga);
    font-weight: 800;
    font-size: 0.75rem;
    padding: 0.4rem 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
    margin-left: 1.5rem;
    transition: transform 0.2s;
}
.view-replies-btn:hover {
    transform: translateX(4px);
}

body.dark-mode .reply-toggle-btn {
    color: var(--white);
}
body.dark-mode .view-replies-btn {
    color: #ff5555;
}
body.dark-mode .replies-container {
    border-left-color: var(--white) !important;
}

/* ============================================================
   SHARED IN-PAGE SEARCH & CARD HIGHLIGHT STYLES
   ============================================================ */
.watch-orders-search-wrapper {
    margin: 1rem auto 2.5rem auto;
    max-width: 900px;
    width: 100%;
    position: relative;
}
.manga-search-box {
    position: relative;
    display: flex;
    border: 4px solid var(--black);
    box-shadow: 8px 8px 0 var(--black);
    background: var(--white);
    transition: transform 0.2s, box-shadow 0.2s;
    align-items: center;
}
.manga-search-box:focus-within {
    transform: translate(-4px, -4px);
    box-shadow: 12px 12px 0 var(--black);
}

/* Suggestions Dropdown styling */
.manga-suggestion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.95rem;
    border-bottom: 3px solid var(--black);
    transition: background 0.15s, color 0.15s;
    text-transform: uppercase;
    color: var(--black);
    font-family: var(--font-main);
}
.manga-suggestion-item:last-child {
    border-bottom: none;
}
.manga-suggestion-item:hover, .manga-suggestion-item.selected {
    background: var(--black);
    color: var(--white);
}
.manga-suggestion-item .suggestion-number {
    font-family: var(--font-jp);
    font-size: 0.8rem;
    font-weight: 900;
    opacity: 0.7;
    background: var(--gray-light);
    color: var(--black);
    padding: 0.2rem 0.6rem;
    border: 2px solid var(--black);
    border-radius: 4px;
    transition: all 0.15s;
}
.manga-suggestion-item:hover .suggestion-number, .manga-suggestion-item.selected .suggestion-number {
    background: var(--white);
    color: var(--black);
}

/* Custom Scrollbar for suggestions */
#watch-orders-suggestions::-webkit-scrollbar,
#explainers-suggestions::-webkit-scrollbar,
#toplists-suggestions::-webkit-scrollbar,
#chardives-suggestions::-webkit-scrollbar,
#mva-suggestions::-webkit-scrollbar {
    width: 8px;
}
#watch-orders-suggestions::-webkit-scrollbar-track,
#explainers-suggestions::-webkit-scrollbar-track,
#toplists-suggestions::-webkit-scrollbar-track,
#chardives-suggestions::-webkit-scrollbar-track,
#mva-suggestions::-webkit-scrollbar-track {
    background: var(--white);
    border-left: 2px solid var(--black);
}
#watch-orders-suggestions::-webkit-scrollbar-thumb,
#explainers-suggestions::-webkit-scrollbar-thumb,
#toplists-suggestions::-webkit-scrollbar-thumb,
#chardives-suggestions::-webkit-scrollbar-thumb,
#mva-suggestions::-webkit-scrollbar-thumb {
    background: var(--black);
    border-left: 2px solid var(--black);
}

/* Highlight Animation */
@keyframes manga-highlight {
    0% {
        box-shadow: 0 0 0 0 var(--accent);
        border-color: var(--accent);
        transform: scale(1);
    }
    30% {
        box-shadow: 0 0 0 20px rgba(255, 0, 85, 0.4);
        border-color: var(--accent);
        transform: scale(1.03);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 0, 85, 0.2);
        border-color: var(--accent);
        transform: scale(1.01);
    }
    100% {
        box-shadow: var(--shadow-offset) var(--shadow-offset) 0px var(--black);
        border-color: var(--black);
        transform: scale(1);
    }
}

.rank-panel.highlight-active {
    animation: manga-highlight 1.8s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 99;
}

/* ── Features Dropdown Menu (Brutalist style) ─────────────────── */
.nav-dropdown-wrap {
    position: relative;
    display: inline-block;
}

.nav-dropdown-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--black);
    padding: 0.25rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    text-transform: uppercase;
    transition: color 0.15s;
}

.nav-dropdown-btn:hover {
    color: var(--accent);
}

.nav-dropdown-btn .arrow {
    font-size: 0.7rem;
    transition: transform 0.15s;
}

.nav-dropdown-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    background: var(--white);
    border: var(--border-w) solid var(--black);
    min-width: 220px;
    z-index: 2000;
    box-shadow: 6px 6px 0 var(--black);
}

.nav-dropdown-menu.open {
    display: flex;
}

.nav-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.1rem;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    color: var(--black);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-main);
    border-bottom: 2px solid var(--black);
    transition: background 0.15s, color 0.15s;
    width: 100%;
}

.nav-dropdown-menu .dropdown-item:last-child {
    border-bottom: none;
}

.nav-dropdown-menu .dropdown-item:hover {
    background: var(--black);
    color: var(--white);
}

/* Mobile responsive menu overrides */
@media (max-width: 640px) {
    .nav-dropdown-wrap {
        display: block;
        width: 100%;
    }

    .nav-dropdown-btn {
        width: 100%;
        padding: 1.2rem 1rem;
        font-size: 1.1rem;
        border: none;
        justify-content: space-between;
    }

    .nav-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-top: 2px solid var(--black);
        margin-top: 0;
        width: 100%;
        background: var(--gray-light);
        display: none;
    }
    
    .nav-dropdown-menu.open {
        display: flex;
    }

    .nav-dropdown-menu .dropdown-item {
        padding: 1.2rem 1.5rem;
        font-size: 1rem;
        border-bottom: 2px solid var(--white);
    }
    
    .nav-dropdown-menu .dropdown-item:last-child {
        border-bottom: none;
    }
}

/* ── Daily Featured Post Cards & Dark Mode overrides ──────────────── */
.daily-post-card {
    transition: transform 0.2s, box-shadow 0.2s;
}
.daily-post-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 9px 9px 0 var(--black) !important;
}

/* Dark Mode Styles */
body.dark-mode .daily-post-card {
    background: #1a1a1a !important;
    border-color: var(--black) !important;
    box-shadow: 6px 6px 0 var(--black) !important;
}
body.dark-mode .daily-post-card:hover {
    box-shadow: 9px 9px 0 var(--black) !important;
}
body.dark-mode .daily-post-card h3 {
    color: var(--black) !important;
}
body.dark-mode .daily-post-card p {
    color: var(--gray-dark) !important;
}
body.dark-mode .daily-post-card .daily-date {
    color: var(--white) !important;
}
body.dark-mode .daily-post-card span {
    border-color: var(--black) !important;
}

/* ── Archive Filter Wrapper & Dark Mode ──────────────── */
.archive-filter-wrap {
    transition: transform 0.2s;
}
body.dark-mode .archive-filter-wrap {
    background: #1a1a1a !important;
    border-color: var(--black) !important;
    box-shadow: 6px 6px 0 var(--black) !important;
}
body.dark-mode .filter-label {
    color: var(--black) !important;
}
body.dark-mode .filter-input,
body.dark-mode .filter-select,
body.dark-mode #global-page-date-filter {
    background: #111 !important;
    color: var(--black) !important;
    border-color: var(--black) !important;
}
body.dark-mode #global-page-date-filter option {
    background: #111 !important;
    color: var(--black) !important;
}




