/* ═══════════════════════════════════════════════════════════════
   THORNEVERSE - COMPONENT STYLES
   Buttons, Cards, Tags, Modals, Forms
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 2rem;
    font-family: 'Cinzel', serif;
    font-size: clamp(0.7rem, 1.8vw, 0.85rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-normal);
    min-width: 100px;
}

/* Primary Button - Gold */
.btn-primary {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--gold-dark);
    color: var(--gold-bright);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--gold-bright);
    box-shadow: 0 0 30px var(--shadow-gold);
    background: rgba(0, 0, 0, 0.85);
}

/* Enter/CTA Button - Crimson */
.btn-enter {
    background: linear-gradient(180deg, rgba(160, 16, 48, 0.85), rgba(107, 15, 26, 0.95));
    border: 1px solid var(--blood-glow);
    color: var(--text-bright);
}

.btn-enter:hover,
.btn-enter:focus {
    background: linear-gradient(180deg, rgba(180, 20, 55, 0.9), rgba(130, 18, 32, 1));
    box-shadow: 0 0 20px rgba(196, 26, 58, 0.4);
}

/* Secondary/Leave Button */
.btn-secondary {
    background: transparent;
    border: 1px solid var(--text-dim);
    color: var(--text-dim);
}

.btn-secondary:hover,
.btn-secondary:focus {
    border-color: var(--text-soft);
    color: var(--text-soft);
}

/* Read Button */
.btn-read {
    background: transparent;
    border: 1px solid var(--gold-bright);
    color: var(--gold-bright);
}

.btn-read:hover,
.btn-read:focus {
    background: var(--gold-bright);
    color: var(--bg-secondary);
}

/* Buy Button */
.btn-buy {
    background: var(--crimson-light);
    border: 1px solid var(--crimson-light);
    color: var(--text-bright) !important;
}

.btn-buy:hover,
.btn-buy:focus {
    background: var(--crimson);
    border-color: var(--crimson);
}

/* Disabled Button */
.btn-disabled,
.btn:disabled {
    background: transparent;
    border: 1px solid #444;
    color: #666;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}

/* Coming Soon Button */
.btn-coming-soon {
    background: #333;
    border: 1px solid #444;
    color: #888;
    cursor: not-allowed;
}

/* Back Button */
.btn-back {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: var(--z-fixed);
    background: var(--bg-card-solid);
    border: 1px solid var(--gold-bright);
    color: var(--gold-bright);
    padding: 10px 20px;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 4px;
}

.btn-back:hover,
.btn-back:focus {
    background: var(--gold-bright);
    color: var(--bg-secondary);
}

/* Library Button */
.btn-library {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: var(--z-modal);
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--border-gold);
    color: #c9a959;
    padding: 0.6rem 1.2rem;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    text-decoration: none;
    letter-spacing: 1px;
    border-radius: 4px;
}

.btn-library:hover,
.btn-library:focus {
    background: rgba(201, 169, 89, 0.15);
    border-color: #c9a959;
}

/* Icon Button (Reader) */
.btn-icon {
    width: 36px;
    height: 36px;
    background: rgba(128, 0, 255, 0.15);
    border: 1px solid var(--border-purple);
    border-radius: 8px;
    color: var(--reader-accent);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover,
.btn-icon:active {
    background: rgba(128, 0, 255, 0.4);
}

.btn-icon.danger {
    background: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.3);
    color: var(--reader-danger);
}

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-crimson);
    padding: 1.5rem 1.75rem;
    transition: var(--transition-normal);
}

/* Series Card */
.series-card {
    background: var(--bg-card);
    border: 1px solid var(--border-crimson);
    padding: 1.5rem 1.75rem;
    border-top: 3px solid;
    border-image: linear-gradient(90deg, var(--crimson), var(--purple-smoke), var(--gold-bright)) 1;
    transition: var(--transition-normal);
}

.series-card:hover {
    background: rgba(0, 0, 0, 0.85);
    border-color: var(--crimson);
    transform: translateY(-3px);
}

.series-card-link {
    text-decoration: none;
    display: block;
}

.series-card .series-name {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    letter-spacing: 0.08em;
    color: var(--text-bright);
    margin-bottom: 0.4rem;
}

.series-card .series-genre {
    font-size: 0.95rem;
    color: var(--blood-glow);
    font-style: italic;
    margin-bottom: 1rem;
}

.series-card .series-desc {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-soft);
}

/* Book Card */
.book-card {
    background: rgba(20, 12, 16, 0.9);
    border: 1px solid rgba(212, 160, 32, 0.3);
    border-radius: 12px;
    padding: 20px;
    transition: var(--transition-normal);
}

.book-card:hover {
    border-color: var(--gold-bright);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.book-card .book-number {
    font-family: 'Cinzel', serif;
    color: var(--crimson-light);
    font-size: 0.8rem;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.book-card .book-title {
    font-family: 'Cinzel', serif;
    color: var(--gold-bright);
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.book-card .book-status {
    color: var(--purple-bright);
    font-size: 0.85rem;
    font-style: italic;
}

.book-card .book-status.available {
    color: var(--gold-shine);
}

.book-card .book-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.book-card.coming-soon {
    opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════
   TAGS (Content Warnings)
   ═══════════════════════════════════════════════════════════════ */

.warning-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.tag {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 3px;
    letter-spacing: 1px;
    color: var(--text-bright);
}

.tag-dubcon { background: #8b1020; }
.tag-cnc { background: #6a2c7a; }
.tag-dark { background: #1a0a15; border: 1px solid #8b1020; }
.tag-murder { background: #2d0a0a; border: 1px solid #8b0000; }
.tag-violence { background: #3d1a1a; }
.tag-nosex { background: #333333; }
.tag-noncon { background: #660022; }
.tag-college { background: #4a3060; }
.tag-assault { background: #8b1020; }
.tag-tbd { background: #333333; color: #888888; }

/* ═══════════════════════════════════════════════════════════════
   MODALS & OVERLAYS
   ═══════════════════════════════════════════════════════════════ */

/* Warning/Age Gate Screen */
.warning-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    z-index: var(--z-modal);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    overflow-y: auto;
}

.warning-screen.active {
    display: flex;
}

.warning-content {
    max-width: 680px;
    text-align: center;
}

.warning-icon {
    font-size: 2.5rem;
    color: var(--blood-glow);
    margin-bottom: 1.5rem;
}

.warning-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.8rem, 5vw, 3rem);
    letter-spacing: 0.15em;
    color: var(--blood-glow);
    margin-bottom: 2rem;
}

.warning-text {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    line-height: 1.9;
    color: var(--text-bright);
    margin-bottom: 1.25rem;
}

.age-box {
    margin: 2rem 0;
    padding: 1.5rem 1rem;
    border-top: 1px solid rgba(139, 16, 32, 0.5);
    border-bottom: 1px solid rgba(139, 16, 32, 0.5);
}

.age-box p {
    font-family: 'Cinzel', serif;
    font-size: clamp(0.85rem, 2vw, 1.05rem);
    letter-spacing: 0.08em;
    color: var(--text-soft);
    line-height: 2;
}

/* Text highlights for warnings */
.highlight { color: var(--gold-bright); font-weight: 600; }
.strong { color: var(--blood-glow); font-weight: 600; }
.legal { color: var(--text-dim); }
.real-talk { color: var(--gold-bright); font-weight: 600; }
.grown { color: var(--text-bright); font-style: italic; }
.ruined { color: var(--blood-glow); font-weight: 700; text-transform: uppercase; }
.emphasis { font-style: italic; color: var(--text-soft); }

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Panel Overlay */
.panel-overlay {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 70px;
    background: rgba(0, 0, 0, 0.6);
    z-index: var(--z-overlay);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.panel-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-purple);
    border-radius: 8px;
    color: var(--text-bright);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--reader-accent);
    box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.2);
}

.form-input::placeholder {
    color: var(--text-dim);
}

/* Search Box */
.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.search-input {
    flex: 1;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-purple);
    border-radius: 8px;
    color: var(--text-bright);
    font-size: 0.9rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--reader-accent);
}

.search-btn {
    padding: 10px 15px;
    background: rgba(128, 0, 255, 0.3);
    border: 1px solid rgba(128, 0, 255, 0.4);
    border-radius: 8px;
    color: var(--reader-accent);
    cursor: pointer;
}

/* Toggle Switch */
.toggle-switch {
    width: 50px;
    height: 26px;
    background: rgba(128, 0, 255, 0.2);
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: background var(--transition-normal);
}

.toggle-switch.on {
    background: rgba(128, 0, 255, 0.6);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform var(--transition-normal);
}

.toggle-switch.on::after {
    transform: translateX(24px);
}

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */

.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(128, 0, 255, 0.9);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    z-index: 200;
    opacity: 0;
    transition: all var(--transition-normal);
}

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

.toast.success {
    background: rgba(34, 197, 94, 0.9);
}

.toast.error {
    background: rgba(220, 38, 38, 0.9);
}

/* ═══════════════════════════════════════════════════════════════
   DRAWER (Bottom Sheet)
   ═══════════════════════════════════════════════════════════════ */

.drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 85vh;
    background: var(--bg-card-solid);
    border-top: 2px solid var(--gold-bright);
    border-radius: 20px 20px 0 0;
    transform: translateY(calc(100% - 120px));
    transition: transform var(--transition-slow);
    z-index: var(--z-drawer);
    overflow: hidden;
}

.drawer.open {
    transform: translateY(0);
}

.drawer .handle-bar {
    width: 50px;
    height: 4px;
    background: var(--gold-bright);
    border-radius: 2px;
    margin: 12px auto 0;
    opacity: 0.7;
}

.drawer-content {
    height: 100%;
    overflow-y: auto;
    padding: 15px 20px 40px;
    -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE - COMPONENTS
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
        align-items: center;
    }

    .button-group .btn {
        width: 100%;
        max-width: 260px;
    }

    .series-card {
        padding: 1.25rem;
    }

    .series-card .series-desc {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.75rem 1.5rem;
    }

    .book-card {
        padding: 15px;
    }

    .book-card .book-buttons {
        flex-direction: column;
    }

    .book-card .book-buttons .btn {
        width: 100%;
    }
}
