/* ═══════════════════════════════════════════
   common.css – Shared styles for AnimeWelt
   ═══════════════════════════════════════════ */

/* ── Theme Variables (hAnime Gold Standard Default) ── */
:root {
    --bg: #04050d;
    --bg2: #080a14;
    --card: #0c0e1a;
    --card2: #111628;
    --accent: #e63fff;   /* Pink als primäre Accent-Farbe */
    --accent2: #00d4ff;  /* Cyan als sekundäre Accent-Farbe */
    --gold: #ffd700;
    --text: #e8eaf6;
    --muted: rgba(232, 234, 246, 0.4);
    --border: rgba(255, 255, 255, 0.07);
    --glow-pink: rgba(230, 63, 255, 0.45);
    --glow-blue: rgba(0, 212, 255, 0.4);
    --glow-accent: rgba(230, 63, 255, 0.25);
    --theme-name: 'hanime';

    /* Glassmorphism Premium Variables */
    --glass-bg: rgba(12, 14, 26, 0.65);
    --glass-bg-hover: rgba(230, 63, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.07);
    --glass-border-highlight: rgba(230, 63, 255, 0.3);
    --glass-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

/* ── Global Body & Select Defaults ── */
body {
    background-color: var(--bg, #04050d);
    color: var(--text, #e8eaf6);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
}

select, option {
    background-color: #0c0e1a !important;
    color: #e8eaf6 !important;
}

/* ── Global Animated Background Gradients ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 15% 25%, rgba(230, 63, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 75%, rgba(0, 212, 255, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(123, 47, 247, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

/* SVG Noise Overlay Utility */
.noise-overlay {
    position: relative;
}
.noise-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    border-radius: inherit;
}

[data-theme="sakura"],
html[data-theme="sakura"] {
    --bg: #0d0610;
    --card: #160b1c;
    --card2: #1f1028;
    --accent: #ff79c6;
    --accent2: #bd93f9;
    --text: #f8d7ea;
    --muted: rgba(255, 200, 220, 0.45);
    --border: rgba(255, 121, 198, 0.15);
    --theme-name: 'sakura';
}

[data-theme="cyber"],
html[data-theme="cyber"] {
    --bg: #000a0f;
    --card: #001520;
    --card2: #002030;
    --accent: #00ffe7;
    --accent2: #0077ff;
    --text: #cff4ff;
    --muted: rgba(100, 220, 255, 0.45);
    --border: rgba(0, 255, 231, 0.12);
    --theme-name: 'cyber';
}

[data-theme="amoled"],
html[data-theme="amoled"] {
    --bg: #000000;
    --card: #0a0a0a;
    --card2: #111111;
    --accent: #ffffff;
    --accent2: #888888;
    --text: #ffffff;
    --muted: rgba(255, 255, 255, 0.5);
    --border: rgba(255, 255, 255, 0.06);
    --theme-name: 'amoled';
}

[data-theme="hanime"],
html[data-theme="hanime"] {
    --bg: #04050d;
    --bg2: #080a14;
    --card: #0c0e1a;
    --card2: #111628;
    --accent: #e63fff;
    --accent2: #00d4ff;
    --gold: #ffd700;
    --text: #e8eaf6;
    --muted: rgba(232, 234, 246, 0.4);
    --border: rgba(255, 255, 255, 0.07);
    --theme-name: 'hanime';
    --glow-accent: rgba(230, 63, 255, 0.25);
    --glow-pink: rgba(230, 63, 255, 0.45);
}

/* Dynamic Japanese ink lines class */
.ink-deco {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.03;
    background: repeating-linear-gradient(90deg, #fff 0px, #fff 1px, transparent 1px, transparent 40px);
}


/* ── Shared Nav (Dropdown) & Page Header ── */
.page-header, .header {
    position: sticky;
    top: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 32px;
    height: 60px;
    background: rgba(4, 5, 13, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(230, 63, 255, 0.15);
}

.page-header::after, .header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
    opacity: .7;
}

/* ── Subpage Hero Banner ── */
.page-hero-banner {
    padding: 60px 20px 40px;
    text-align: center;
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.page-hero-banner h1 {
    font-family: 'Cinzel Decorative', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #fff 30%, var(--accent) 70%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(230, 63, 255, 0.2);
}

.page-hero-banner p {
    color: var(--muted);
    font-size: 0.95rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Scroll-Triggered Reveal Animations ── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.slide-left {
    transform: translateX(-40px);
}

.reveal.slide-right {
    transform: translateX(40px);
}

.reveal.zoom-in {
    transform: scale(0.92);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

.aw-nav-dropdown {
    position: relative;
}

/* ── Sakura Particles Canvas ── */
#sakura-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 10;
    display: none;
}
html[data-theme="sakura"] #sakura-canvas {
    display: block;
}

/* ── Glassmorphism Utility & Global Overrides ── */
.glass-panel, .nav-card, .search-section, .recent-card, .card, .modal-box, .lightbox-inner, .mood-card {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow);
}

.glass-panel:hover, .nav-card:hover, .recent-card:hover, .card:hover, .mood-card:hover {
    border-color: var(--glass-border-highlight) !important;
    background: var(--glass-bg-hover) !important;
}

.aw-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 25px;
    padding: 9px 18px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    transition: all .2s;
}

.aw-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.aw-nav-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    background: #0b0d19 !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 14px;
    min-width: 240px;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 999999 !important;
    opacity: 1 !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95), 0 0 30px rgba(230, 63, 255, 0.2) !important;
    animation: menuDrop .18s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

[data-theme="sakura"] .aw-nav-menu { background: #180a1e !important; }
[data-theme="cyber"] .aw-nav-menu { background: #00121c !important; }
[data-theme="amoled"] .aw-nav-menu { background: #050505 !important; }
[data-theme="hanime"] .aw-nav-menu { background: #0b0d19 !important; }

/* When menu would overflow left edge, flip it to align left instead */
.aw-nav-menu.flip-left {
    right: auto;
    left: 0;
}

.aw-nav-menu::-webkit-scrollbar {
    width: 4px;
}

.aw-nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.aw-nav-menu::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

@keyframes menuDrop {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

.aw-nav-menu.open {
    display: block;
}

.aw-nav-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    text-decoration: none;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    transition: all .15s;
}

.aw-nav-menu a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.aw-nav-menu a.current {
    color: var(--accent);
    font-weight: 700;
    background: rgba(0, 212, 255, 0.05);
}

.aw-nav-menu .nav-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* ── Shared Footer ── */
.aw-footer {
    border-top: 1px solid var(--border);
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin-top: auto;
}

.aw-footer .footer-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.aw-footer .footer-links a {
    color: var(--muted);
    text-decoration: none;
    transition: color .2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

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

/* ── Scroll-to-Top Button ── */
#aw-scroll-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.35);
    opacity: 0;
    transform: scale(0.6) translateY(20px);
    transition: opacity .3s, transform .3s;
    pointer-events: none;
}

#aw-scroll-top.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

#aw-scroll-top:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(0, 212, 255, 0.55);
}

/* ── Theme-Switcher Button ── */
.aw-theme-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--muted);
    border-radius: 20px;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

/* ── Achievement Badges ── */
.achievements-section {
    padding: 0 20px 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.achievement-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.achievement-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: all .25s;
    min-width: 200px;
}

.achievement-badge.earned {
    border-color: var(--accent);
    background: rgba(0, 212, 255, 0.06);
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.12);
}

.achievement-badge.locked {
    opacity: 0.4;
    filter: grayscale(1);
}

.achievement-icon {
    font-size: 28px;
}

.achievement-info h5 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.achievement-info p {
    font-size: 11px;
    color: var(--muted);
}

.ach-check {
    margin-left: auto;
    flex-shrink: 0;
    color: #00e676;
    font-size: 16px;
    font-weight: 900;
}

/* Achievement progress summary */
.achievement-summary {
    width: 100%;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ach-earned {
    font-weight: 900;
    font-size: 18px;
    color: var(--accent);
}

.ach-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, .08);
    border-radius: 4px;
    overflow: hidden;
    max-width: 300px;
}

.ach-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 4px;
    transition: width .6s ease;
}


/* ── Lightbox ── */
.aw-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn .2s ease;
}

.aw-lightbox.open {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.lightbox-inner {
    display: flex;
    gap: 28px;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 0 80px rgba(0, 0, 0, .9);
    animation: zoomIn .3s ease;
}

.lightbox-img {
    width: 320px;
    min-width: 220px;
    object-fit: cover;
    flex-shrink: 0;
}

.lightbox-info {
    padding: 28px 24px;
    overflow-y: auto;
    flex: 1;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    background: rgba(255, 255, 255, .1);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

.lightbox-close:hover {
    background: rgba(255, 82, 82, .5);
}

.lightbox-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}

.lightbox-meta {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 14px;
    line-height: 1.8;
}

.lightbox-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, .7);
    line-height: 1.7;
    margin-bottom: 18px;
}

.lightbox-stars {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.lightbox-star {
    font-size: 20px;
    cursor: pointer;
    transition: transform .15s;
    color: rgba(255, 255, 255, .2);
}

.lightbox-star.active {
    color: #ffd700;
}

.lightbox-star:hover {
    transform: scale(1.3);
    color: #ffd700;
}

@media (max-width: 640px) {
    .lightbox-inner {
        flex-direction: column;
    }

    .lightbox-img {
        width: 100%;
        height: 200px;
        min-width: unset;
    }
}

/* ── Star Rating on Card ── */
.star-row {
    display: flex;
    align-items: center;
    gap: 3px;
    margin: 6px 0;
}

.star-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: rgba(255, 255, 255, .2);
    padding: 0;
    line-height: 1;
    transition: color .1s, transform .1s;
}

.star-btn.lit {
    color: #ffd700;
}

.star-btn:hover {
    transform: scale(1.25);
    color: #ffd700;
}

/* ── Favorite Heart ── */
.fav-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: rgba(255, 255, 255, .25);
    padding: 0;
    transition: color .2s, transform .2s;
    line-height: 1;
}

.fav-btn.faved {
    color: #ff4d6d;
    text-shadow: 0 0 12px rgba(255, 77, 109, .7);
}

.fav-btn:hover {
    transform: scale(1.25);
    color: #ff4d6d;
}

/* ── Mood Picker ── */
.mood-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    max-width: 700px;
    margin: 24px auto;
}

.mood-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all .25s;
    font-family: 'Inter', sans-serif;
}

.mood-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .5), 0 0 20px rgba(0, 212, 255, .2);
}

.mood-card .mood-emoji {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}

.mood-card .mood-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

/* ── Progress Bar (Am Schauen) ── */
.ep-progress-wrap {
    margin: 8px 0;
}

.ep-progress-label {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.ep-progress-bar {
    height: 5px;
    background: rgba(255, 255, 255, .1);
    border-radius: 4px;
    overflow: hidden;
}

.ep-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00e676, #00d4ff);
    border-radius: 4px;
    transition: width .4s ease;
}

/* ── Grid/List Toggle ── */
.view-toggle {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px;
}

.view-btn {
    background: none;
    border: none;
    color: var(--muted);
    padding: 5px 10px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 13px;
    transition: all .2s;
}

.view-btn.active {
    background: var(--accent);
    color: #000;
}

/* ── List View ── */
.gallery.list-view {
    grid-template-columns: 1fr !important;
}

.gallery.list-view .card {
    display: flex;
    flex-direction: row;
}

.gallery.list-view .card-img-wrap {
    width: 140px;
    min-width: 140px;
    height: auto !important;
}

.gallery.list-view .card-content {
    flex: 1;
}

/* ── Tier-List ── */
.tier-section {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 6px;
    border-radius: 10px;
    overflow: hidden;
    min-height: 80px;
}

.tier-label {
    width: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 900;
    flex-shrink: 0;
}

.tier-items {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, .03);
    border-left: 2px solid rgba(255, 255, 255, .06);
    min-height: 80px;
}

.tier-item {
    width: 70px;
    border-radius: 8px;
    overflow: hidden;
    cursor: grab;
    transition: transform .2s;
    flex-shrink: 0;
    user-select: none;
}

.tier-item:hover {
    transform: scale(1.08);
}

.tier-item:active {
    cursor: grabbing;
}

.tier-item img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.tier-item .tier-item-title {
    font-size: 9px;
    text-align: center;
    padding: 3px 2px;
    color: #fff;
    background: rgba(0, 0, 0, .7);
    word-break: break-word;
}

.pool-area {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, .02);
    border-radius: 12px;
    min-height: 100px;
    margin-top: 20px;
    border: 1px dashed var(--border);
}

.sortable-ghost {
    opacity: .25;
}