/**
 * Firefly MUD - Custom Theme Overrides
 * Sumi-e (Ink Wash) Light Theme
 */

/* ================================
   CSS Custom Properties
   ================================ */
:root {
    --prom-bg-darker: #E8E0D4;
    --prom-bg-dark: #F5F0E8;
    --prom-text-light: #27221F;
    --prom-accent: #C23B22;
}

/* ================================
   Button Icon Alignment
   ================================ */
.btn i.bi {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

/* ================================
   Global Styles
   ================================ */
body {
    font-family: 'Source Serif 4', Georgia, serif;
    min-height: 100vh;
}

/* ================================
   Background Utilities
   ================================ */
.bg-darker {
    background-color: var(--prom-bg-darker) !important;
}

/* ================================
   Navbar Brand Logo
   ================================ */
.brand-logo {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ================================
   Scroll to Top Button
   ================================ */
.btn-scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(39, 34, 31, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.btn-scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.btn-scroll-top:hover {
    transform: translateY(-3px);
}

/* ================================
   Navbar Transparency (over parallax banner)
   ================================ */
.navbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: transparent !important;
    border-bottom-color: transparent !important;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar.navbar-solid {
    background: var(--prom-bg-dark, #F5F0E8) !important;
    border-bottom: 1px solid rgba(39, 34, 31, 0.15) !important;
    box-shadow: 0 1px 4px rgba(39, 34, 31, 0.08);
}

/* Space for fixed navbar so content isn't hidden behind it */
body {
    padding-top: 0; /* Banner sits behind navbar; non-banner pages get padding from .parallax-banner */
}

/* ================================
   Parallax Banner
   ================================ */
.parallax-banner {
    position: relative;
    overflow: hidden;
    background: var(--prom-bg-dark, #F5F0E8);
}

.parallax-banner .layer {
    position: absolute;
    left: 0;
    top: -10%;
    width: 100%;
}

.parallax-banner .layer img {
    width: 100%;
    height: auto;
    display: block;
}

.parallax-banner .layer-1 {
    z-index: 1;
    margin-top: -20%;
}

.parallax-banner .layer-2 {
    z-index: 2;
}

.parallax-banner .layer-3 {
    z-index: 3;
}

/* Large banner (home page) */
.banner-large {
    height: 600px;
}

.banner-large .banner-text {
    top: 18%;
}

/* Small banner (sub-pages) */
.banner-small {
    height: 200px;
}

.banner-small .layer {
    top: -45%;
}

.banner-small .layer-1 {
    margin-top: -20%;
}

.banner-small .banner-text {
    top: 50%;
    transform: translateY(-50%);
}

/* Banner overlay text */
.banner-text {
    position: absolute;
    z-index: 10;
    width: 100%;
    text-align: center;
    color: #27221F;
    text-shadow: 0 0 20px rgba(245, 240, 232, 0.8), 0 0 40px rgba(245, 240, 232, 0.6);
    padding: 0 1rem;
}

.banner-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.banner-text p {
    font-size: 1.125rem;
    color: rgba(39, 34, 31, 0.7);
    margin-bottom: 0;
}

/* Hero actions (home page CTA buttons) */
.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ================================
   Feature Cards
   ================================ */

/* ================================
   Activity Items
   ================================ */
.activity-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(39, 34, 31, 0.08);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* ================================
   Status Indicator
   ================================ */
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.online {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

/* ================================
   Tab Panels (visibility handled by layout.erb)
   ================================ */

/* ================================
   Form Overrides
   ================================ */
.form-select:focus {
    border-color: var(--prom-accent);
    box-shadow: 0 0 0 0.25rem rgba(194, 59, 34, 0.15);
}

/* ================================
   Page Headers
   ================================ */
.page-header {
    font-family: 'Ma Shan Zheng', cursive;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(39, 34, 31, 0.1);
}

/* ================================
   Content Cards
   ================================ */
.content-card {
    background-color: rgba(245, 240, 232, 0.95);
    border: 1px solid #D4C9B8;
    border-radius: 0.125rem;
    padding: 1.5rem;
}

/* ================================
   Sidebar Styling
   ================================ */
.sidebar .card {
    margin-bottom: 1.5rem;
}

/* Breadcrumb styles are in layout.erb */

/* ================================
   Footer Links
   ================================ */
footer a:hover {
    color: #27221F !important;
    text-decoration: underline;
}

/* ================================
   Emote & Roleplay Styling
   ================================ */

/* Spotlight emote - outdented block for characters with camera focus */
.spotlight-emote {
    margin-left: -1rem;
    padding-left: 1rem;
    border-left: 3px solid var(--prom-accent, #C23B22);
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    background: rgba(194, 59, 34, 0.03);
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    padding-right: 0.5rem;
    border-radius: 0 4px 4px 0;
}

/* ================================
   Responsive Adjustments
   ================================ */
@media (max-width: 992px) {
    .banner-large {
        height: 450px;
    }
}

@media (max-width: 576px) {
    .banner-large {
        height: 350px;
    }

    .banner-text h1 {
        font-size: 1.75rem;
    }

    .banner-small {
        height: 160px;
    }

    .btn-scroll-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}

/* ================================
   Atmospheric Emits
   ================================ */
.atmospheric-emit {
    color: #8b8b8b;
    font-style: italic;
    font-size: 0.9em;
    padding: 4px 0;
    border-left: 2px solid #D4C9B8;
    padding-left: 8px;
    margin: 4px 0;
    opacity: 0.85;
}

/* ================================
   Observation Panel - Exits
   ================================ */
.obs-exits {
    color: #5C5450;
}

.obs-exit,
.obs-exit:link,
.obs-exit:visited {
    color: #5C5450 !important;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s, text-decoration 0.2s;
}

.obs-exit:hover {
    text-decoration: underline;
    opacity: 0.85;
}

.obs-exit:active {
    color: inherit !important;
}

.obs-exit-locked {
    opacity: 0.5;
    cursor: not-allowed;
    color: var(--text-muted, #888);
}

.obs-exit-locked:hover {
    text-decoration: line-through;
}

.obs-exit sup {
    font-size: 0.65em;
    line-height: 1;
    opacity: 0.7;
    margin-left: 1px;
    vertical-align: super;
}

/* ================================
   Observation Panel - Quickmenu
   ================================ */
.obs-quickmenu {
    padding: 1rem;
    background: #F5F0E8;
    border: 1px solid rgba(194, 59, 34, 0.3);
    border-radius: 0.125rem;
    opacity: 0;
    transform: translateY(-8px);
    animation: quickmenuSlideIn 150ms ease-out forwards;
}

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

.obs-quickmenu.closing {
    animation: quickmenuSlideOut 100ms ease-out forwards;
}

@keyframes quickmenuSlideOut {
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

.obs-quickmenu-prompt {
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: #C23B22;
    font-size: 0.9rem;
}

.obs-quickmenu-options {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.obs-quickmenu-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(39, 34, 31, 0.03);
    border: 1px solid rgba(39, 34, 31, 0.08);
    border-radius: 0.125rem;
    cursor: pointer;
    transition: all 100ms ease-out;
}

.obs-quickmenu-option:hover {
    background: rgba(194, 59, 34, 0.06);
    border-color: rgba(194, 59, 34, 0.3);
}

.obs-quickmenu-option .obs-option-number {
    color: #C23B22;
    font-family: monospace;
    font-weight: 600;
    min-width: 1.5em;
    font-size: 0.9em;
}

.obs-quickmenu-option .obs-option-label {
    flex: 1;
    color: #27221F;
}

.obs-quickmenu-option .obs-option-desc {
    color: #999;
    font-size: 0.85em;
}

.obs-quickmenu-hint {
    margin-top: 0.75rem;
    font-size: 0.8em;
    color: #999;
    text-align: center;
}

/* ================================
   Observation Panel - Form
   ================================ */
.obs-form {
    padding: 1rem;
}

.obs-form-title {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.obs-form-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.obs-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.obs-form-field label {
    font-weight: 500;
    color: var(--text-primary);
}

.obs-form-field .obs-required {
    color: var(--error-color, #e53935);
    margin-left: 0.25em;
}

.obs-form-field input,
.obs-form-field textarea,
.obs-form-field select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
}

.obs-form-field input:focus,
.obs-form-field textarea:focus,
.obs-form-field select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-primary-transparent, rgba(66, 133, 244, 0.2));
}

.obs-form-field textarea {
    min-height: 80px;
    resize: vertical;
}

.obs-form-field input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.obs-form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.obs-form-submit {
    flex: 1;
    padding: 0.5rem 1rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.obs-form-submit:hover {
    background: var(--accent-primary-hover);
}

.obs-form-cancel {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.obs-form-cancel:hover {
    background: var(--bg-hover);
}

/* ================================
   Observation Panel - Character Display
   ================================ */

.obs-character-name-line {
    font-size: 1.15em;
    font-weight: 600;
    color: var(--prom-accent, #C23B22);
    margin-bottom: 0.25rem;
}

.obs-character-eyes-hair {
    color: #5C5450;
    font-size: 0.95em;
    margin-bottom: 0.5rem;
}

.obs-using-section {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(39, 34, 31, 0.1);
}

.obs-using-list {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0 0;
}

.obs-using-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.15rem 0;
}

.obs-using-held {
    color: #27221F;
}

.obs-using-worn {
    color: #5C5450;
}

.obs-using-separator {
    height: 0.5rem;
    border: none;
    margin: 0;
    padding: 0;
}

.obs-character-intro {
    color: #3a3530;
    font-size: 0.95em;
    margin-bottom: 0.25rem;
}

.obs-character-descriptions {
    margin: 0.5rem 0;
    color: #5C5450;
    font-size: 0.95em;
    line-height: 1.5;
}

.obs-desc-text {
}

.obs-character-status {
    color: #888;
    font-style: italic;
    font-size: 0.9em;
    margin-bottom: 0.25rem;
}

.obs-character-roomtitle {
    color: #888;
    font-size: 0.85em;
    margin-bottom: 0.25rem;
}

.obs-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(39, 34, 31, 0.1);
}

.obs-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(39, 34, 31, 0.1);
}

.obs-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(39, 34, 31, 0.2);
}

.portrait-container {
    position: relative;
    float: left;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
}

.obs-profile-pic {
    max-width: 120px;
    max-height: 120px;
    border-radius: 0.125rem;
    cursor: pointer;
    border: 2px solid rgba(194, 59, 34, 0.3);
}

.portrait-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0.125rem;
    pointer-events: none;
}

.obs-character-display::after {
    content: '';
    display: table;
    clear: both;
}

.obs-section-label {
    color: #888;
    font-size: 0.85em;
    margin-right: 0.5rem;
}

.obs-item-name {
    color: #3a3530;
}

.obs-item-hand {
    color: #999;
    font-size: 0.85em;
    margin-left: 0.25rem;
}

.obs-clothing-section,
.obs-held-section {
    margin-top: 0.5rem;
}

.obs-clothing-list,
.obs-held-list {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0 0;
}

.obs-clothing-item,
.obs-held-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.15rem 0;
}

/* ================================
   Canvas Interactivity
   ================================ */

.canvas-tooltip {
    position: absolute;
    background: rgba(39, 34, 31, 0.9);
    color: #F5F0E8;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Source Serif 4', Georgia, serif;
    pointer-events: none;
    z-index: 10000;
    max-width: 200px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(39, 34, 31, 0.2);
    border: 1px solid rgba(39, 34, 31, 0.2);
}

canvas[data-interactive="true"] {
    cursor: default;
}

canvas[data-interactive="true"]:hover {
}

/* ================================
   Stat Allocation Buttons
   ================================ */
.stat-decrease,
.stat-increase {
    min-width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.stat-decrease:disabled,
.stat-increase:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background-color: #E8E0D4 !important;
    border-color: #D4C9B8 !important;
    color: #999 !important;
}

.stat-decrease:not(:disabled):hover,
.stat-increase:not(:disabled):hover {
    transform: scale(1.1);
}

.stat-decrease:not(:disabled):active,
.stat-increase:not(:disabled):active {
    transform: scale(0.95);
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(39, 34, 31, 0.05);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-name {
    flex: 1;
    font-weight: 500;
}

.stat-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-value {
    min-width: 2em;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
}

.stat-cost {
    font-size: 0.75em;
    color: #888;
    margin-left: 0.5rem;
    min-width: 2.5em;
    text-align: center;
}

/* Voice Preview Error Alert */
.tts-error-alert {
    animation: fadeIn 0.3s ease;
}

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

/* ================================
   Character Creation Checklist
   ================================ */
.completion-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(39, 34, 31, 0.03);
    border-radius: 0.125rem;
    transition: all 0.2s ease;
}

.completion-item:hover {
    background: rgba(39, 34, 31, 0.06);
}

.completion-icon {
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.completion-icon.text-success {
    animation: checkPop 0.3s ease;
}

@keyframes checkPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.completion-label {
    font-weight: 500;
}

.completion-detail {
    width: 100%;
    padding-left: 1.75rem;
    font-size: 0.8em;
}


/* ================================
   Contrast Improvements
   ================================ */

/* Profile page accent color */
.banner-text h1 span,
h1 .text-primary {
    color: var(--prom-accent, #C23B22) !important;
}

/* Completion checklist detail text */
.completion-detail {
    color: #5C5450;
}

/* ================================
   DaisyUI Component Tweaks
   ================================ */

/* DaisyUI prose headings */
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    color: #27221F;
}

/* Fix: btn-outline without a color variant */
.btn-outline:not(.btn-primary):not(.btn-secondary):not(.btn-accent):not(.btn-info):not(.btn-success):not(.btn-warning):not(.btn-error):not(.btn-neutral):not(.btn-ghost) {
    border-color: #D4C9B8;
    color: #27221F;
    background-color: rgba(39, 34, 31, 0.03);
}

/* btn-outline + btn-ghost combo */
.btn-outline.btn-ghost {
    color: #27221F;
}
