/* Custom RPG Stylesheet for FocusFlow OS */

/* Root Typography Setup */
body {
    font-family: 'Inter', sans-serif;
    background-color: #06080d;
    color: #e2e8f0;
}

/* Background Theme Layering & Contrast Control */
.bg-rpg-bgDark {
    background-color: #06080d !important;
}

/* Elevated Goth/RPG Glowing Panel */
.bg-rpg-bgPanel {
    background-color: #0e1420;
    border: 1px solid rgba(138, 111, 39, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

/* Standard High-Contrast RPG Card System */
.rpg-card {
    background-color: #131b2b !important;
    border: 1px solid #232e44 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: all 0.25s ease-in-out;
}
.rpg-card:hover {
    background-color: #162033 !important;
    border-color: #334363 !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Defined Fallbacks for Custom 955 High-Contrast Dark Color Shades */
.bg-slate-955 { background-color: #0d131f !important; }
.bg-slate-955\/40 { background-color: rgba(13, 19, 31, 0.4) !important; }
.bg-slate-955\/60 { background-color: rgba(13, 19, 31, 0.6) !important; }
.bg-slate-955\/80 { background-color: rgba(13, 19, 31, 0.8) !important; }
.bg-slate-955\/90 { background-color: rgba(13, 19, 31, 0.9) !important; }
.text-slate-955 { color: #06080d !important; }

.bg-cyan-955 { background-color: #041d27 !important; }
.bg-cyan-955\/30 { background-color: rgba(4, 29, 39, 0.3) !important; }
.bg-cyan-955\/40 { background-color: rgba(4, 29, 39, 0.4) !important; }
.bg-cyan-955\/60 { background-color: rgba(4, 29, 39, 0.6) !important; }
.bg-cyan-955\/80 { background-color: rgba(4, 29, 39, 0.8) !important; }

.bg-emerald-955 { background-color: #032015 !important; }
.bg-emerald-955\/30 { background-color: rgba(3, 32, 21, 0.3) !important; }
.bg-emerald-955\/40 { background-color: rgba(3, 32, 21, 0.4) !important; }
.bg-emerald-955\/60 { background-color: rgba(3, 32, 21, 0.6) !important; }
.bg-emerald-955\/80 { background-color: rgba(3, 32, 21, 0.8) !important; }

.bg-rose-955 { background-color: #24050e !important; }
.bg-rose-955\/30 { background-color: rgba(36, 5, 14, 0.3) !important; }
.bg-rose-955\/40 { background-color: rgba(36, 5, 14, 0.4) !important; }
.bg-rose-955\/60 { background-color: rgba(36, 5, 14, 0.6) !important; }
.bg-rose-955\/80 { background-color: rgba(36, 5, 14, 0.8) !important; }

.bg-amber-955 { background-color: #221404 !important; }
.bg-amber-955\/20 { background-color: rgba(34, 20, 4, 0.2) !important; }
.bg-amber-955\/30 { background-color: rgba(34, 20, 4, 0.3) !important; }
.bg-amber-955\/40 { background-color: rgba(34, 20, 4, 0.4) !important; }
.bg-amber-955\/80 { background-color: rgba(34, 20, 4, 0.8) !important; }

.bg-purple-955 { background-color: #1a0826 !important; }
.bg-purple-955\/30 { background-color: rgba(26, 8, 38, 0.3) !important; }
.bg-purple-955\/40 { background-color: rgba(26, 8, 38, 0.4) !important; }
.bg-purple-955\/80 { background-color: rgba(26, 8, 38, 0.8) !important; }

.bg-pink-955 { background-color: #26071b !important; }
.bg-pink-955\/40 { background-color: rgba(38, 7, 27, 0.4) !important; }
.bg-pink-955\/80 { background-color: rgba(38, 7, 27, 0.8) !important; }

.bg-indigo-955 { background-color: #0b0d26 !important; }
.bg-indigo-955\/30 { background-color: rgba(11, 13, 38, 0.3) !important; }
.bg-indigo-955\/40 { background-color: rgba(11, 13, 38, 0.4) !important; }

/* Floating Alerts (Loot reveal/errors) */
.toast-alert {
    animation: slideUpFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Medieval Gothic border accents */
.gothic-border {
    position: relative;
    border: 2px solid #8a6f27;
}
.gothic-border::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 1px solid rgba(138, 111, 39, 0.3);
    pointer-events: none;
}

/* Interactive Checkboxes styles */
.quest-checkbox-btn:hover {
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.quest-card:hover {
    transform: translateY(-2px);
}

/* Accordion transition styles for Due Date Groups */
.accordion-group .fa-chevron-down {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.accordion-group.collapsed .fa-chevron-down {
    transform: rotate(-90deg);
}

.accordion-group.collapsed button {
    border-bottom-color: transparent !important;
}

.accordion-content-wrapper {
    max-height: 10000px;
    opacity: 1;
    overflow: hidden;
    border-top: 1px solid rgba(15, 23, 42, 0.6); /* border-slate-900/60 equivalent */
    transition: max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
}

.accordion-content-wrapper.collapsed,
.accordion-group.collapsed > .accordion-content-wrapper {
    max-height: 0 !important;
    opacity: 0 !important;
    border-top-color: transparent !important;
}

/* Individual Quest Card Details Animation */
.quest-details-wrapper {
    max-height: 5000px;
    opacity: 1;
    overflow: hidden;
    margin-top: 0.5rem; /* mt-2 */
    padding-top: 0.75rem; /* pt-3 */
    border-top: 1px solid rgba(15, 23, 42, 0.6); /* border-slate-900/60 */
    transition: max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                margin-top 0.2s ease, 
                padding-top 0.2s ease, 
                border-color 0.2s ease;
}

.quest-details-wrapper.collapsed {
    max-height: 0 !important;
    opacity: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top-color: transparent !important;
}

/* Premium Form Control Styles */
input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #030508 !important;
    border-color: #1a202c !important;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    border-color: #8a6f27 !important;
    box-shadow: 0 0 10px rgba(138, 111, 39, 0.25);
    background-color: #070b10 !important;
}

/* Styled select indicator */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a6f27' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.25rem !important;
}

/* Filter controls bar styling improvements */
.filter-bar-custom select {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    letter-spacing: 0.05em;
    font-size: 10px !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(138, 111, 39, 0.3) !important;
    border-radius: 6px;
    background-color: #06090d !important;
}
.filter-bar-custom select:hover {
    border-color: rgba(212, 175, 55, 0.5) !important;
}

/* Standardized RPG Font Scaling Utilities */
.rpg-font-xs { font-size: 0.7rem !important; }
.rpg-font-s { font-size: 0.75rem !important; }
.rpg-font-m { font-size: 0.875rem !important; }
.rpg-font-l { font-size: 1.125rem !important; }
.rpg-font-xl { font-size: 1.5rem !important; }
.rpg-font-xxl { font-size: 2rem !important; }

/* Vision Board & MindForge Typography Families */
.font-cinzel { font-family: 'Cinzel', serif !important; }
.font-caveat { font-family: 'Caveat', cursive !important; }
.font-marker { font-family: 'Permanent Marker', cursive !important; }
.font-medieval { font-family: 'MedievalSharp', cursive !important; }
.font-playfair { font-family: 'Playfair Display', serif !important; }
.font-inter { font-family: 'Inter', sans-serif !important; }


/* Custom RPG Scrollbar Utilities */
.custom-scrollbar::-webkit-scrollbar,
.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track,
.scrollbar-thin::-webkit-scrollbar-track {
    background: rgba(11, 16, 27, 0.8);
    border-radius: 9999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb,
.scrollbar-thin::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.35);
    border-radius: 9999px;
    border: 1px solid rgba(212, 175, 55, 0.25);
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover,
.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.65);
}
.custom-scrollbar,
.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.35) rgba(11, 16, 27, 0.8);
}

/* Horizontal scrolling helper (hide scrollbars) */
.no-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.no-scrollbar::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

/* Collapsible Card System */
.collapsible-card.collapsed .card-body-content {
    display: none !important;
}
.collapsible-card.collapsed .card-header {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}
.collapsible-card.collapsed .fa-chevron-down {
    transform: rotate(-90deg);
}

/* Shop Card Collapsible Lock Overlay Adaptations */
.collapsible-card.collapsed .absolute.inset-0.bg-slate-950\/85 {
    display: none !important;
}

/* Character Quick Panel collapse transitions */
#characterQuickPanel {
    max-height: 500px;
    opacity: 1;
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out, margin-top 0.4s ease-in-out, padding-top 0.4s ease-in-out, border-top-width 0.4s ease-in-out;
}
#characterQuickPanel.hidden-panel {
    max-height: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top-width: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Header Auto-Shrink on Mobile Scroll */
@media (max-width: 767px) {
    header {
        transition: padding 0.3s ease-in-out;
    }
    header.header-scrolled {
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
    }
    header.header-scrolled #characterQuickPanel:not(.forced-open) {
        max-height: 0 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top-width: 0 !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* High-Priority & Threat Level Border Glow Accents */
.quest-priority-p3 {
    border-color: rgba(217, 119, 6, 0.6) !important;
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.15);
}
.quest-priority-p4 {
    border-color: rgba(225, 29, 72, 0.7) !important;
    box-shadow: 0 0 14px rgba(225, 29, 72, 0.25);
}
.quest-priority-p5,
.quest-priority-p6 {
    border-color: rgba(239, 68, 68, 0.9) !important;
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.35);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(69, 10, 10, 0.35) 100%) !important;
}

/* Deadline Protection Level Badges */
.badge-hard-deadline {
    background-color: rgba(136, 19, 55, 0.7);
    color: #fecdd3;
    border: 1px solid rgba(225, 29, 72, 0.6);
}
.badge-soft-target {
    background-color: rgba(12, 74, 110, 0.6);
    color: #bae6fd;
    border: 1px solid rgba(14, 165, 233, 0.5);
}
.badge-undated-backlog {
    background-color: rgba(15, 23, 42, 0.8);
    color: #94a3b8;
    border: 1px solid rgba(51, 65, 85, 0.8);
}


/* High-Priority & Emergency Spotlight Bar */
.urgent-spotlight-bar {
    background: linear-gradient(135deg, rgba(30, 10, 15, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(225, 29, 72, 0.6);
    box-shadow: 0 0 20px rgba(225, 29, 72, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

/* RPG WYSIWYG Rich Text Editor Styling */
.rpg-editor-container {
    display: flex;
    flex-direction: column;
    width: 100%;
}
.rpg-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem;
    background-color: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(51, 65, 85, 0.8);
    border-bottom: none;
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
}
.rpg-editor-toolbar-btn {
    padding: 0.2rem 0.5rem;
    background-color: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.6);
    border-radius: 0.375rem;
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    user-select: none;
}
.rpg-editor-toolbar-btn:hover {
    background-color: rgba(51, 65, 85, 0.9);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.5);
}
/* RPG Prose & WYSIWYG Content Styling */
.rpg-prose-content {
    color: #e2e8f0;
    font-size: 0.875rem;
    line-height: 1.6;
}
.rpg-editor-content {
    min-height: 120px;
    max-height: 320px;
    overflow-y: auto;
    background-color: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(51, 65, 85, 0.8);
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: #e2e8f0;
    font-size: 0.875rem;
    line-height: 1.6;
    outline: none;
}
.rpg-editor-content:focus {
    border-color: rgba(245, 158, 11, 0.6);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.3);
}
.rpg-prose-content h3, 
.rpg-prose-content h4, 
.rpg-prose-content h5,
.rpg-editor-content h3, 
.rpg-editor-content h4, 
.rpg-editor-content h5 {
    color: #fbbf24;
    font-family: 'Cinzel', serif, system-ui;
    font-weight: 700;
    margin-top: 0.75rem;
    margin-bottom: 0.35rem;
}
.rpg-prose-content h4,
.rpg-editor-content h4 {
    font-size: 1rem;
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
    padding-bottom: 0.2rem;
}
.rpg-prose-content h5,
.rpg-editor-content h5 {
    font-size: 0.875rem;
}
.rpg-prose-content p,
.rpg-editor-content p {
    margin-bottom: 0.5rem;
}
.rpg-prose-content ul,
.rpg-editor-content ul {
    list-style-type: disc;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}
.rpg-prose-content ol,
.rpg-editor-content ol {
    list-style-type: decimal;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}
.rpg-prose-content li,
.rpg-editor-content li {
    margin-bottom: 0.2rem;
}
.rpg-prose-content strong,
.rpg-editor-content strong {
    color: #fef08a;
    font-weight: 700;
}
.rpg-prose-content code,
.rpg-editor-content code {
    background-color: rgba(30, 41, 59, 0.9);
    color: #38bdf8;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    font-family: monospace;
    font-size: 0.8rem;
}

/* Fixed Modal Overlay Reset - Neutralize Tailwind space-y-* margin-top inheritance & enforce z-index hierarchy */
div[class*="fixed"][class*="inset-0"] {
    margin-top: 0 !important;
    margin: 0 !important;
    z-index: 100;
}

/* Deep Link Notification Target Pulse Highlight */
@keyframes rpgCardPulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
        border-color: rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow: 0 0 25px 4px rgba(245, 158, 11, 0.75);
        border-color: rgba(251, 191, 36, 1);
    }
}

.rpg-card-pulse-highlight {
    animation: rpgCardPulseGlow 1s ease-in-out 3;
    border-color: rgba(251, 191, 36, 0.9) !important;
}

/* ==========================================================================
   Seinfeld "Don't Break The Chain" (X-Forge) Animations & Node Styling
   ========================================================================== */

@keyframes xForgeStamp {
    0% {
        transform: scale(2.6) rotate(-15deg);
        opacity: 0;
        filter: brightness(2) drop-shadow(0 0 20px rgba(244, 63, 94, 1));
    }
    45% {
        transform: scale(0.85) rotate(3deg);
        opacity: 1;
        filter: drop-shadow(0 0 14px rgba(239, 68, 68, 0.9));
    }
    75% {
        transform: scale(1.08) rotate(-2deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.animate-xStamp {
    animation: xForgeStamp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Rolling Mini-Chain Connected Link Lines */
.chain-node-link {
    position: relative;
}
.chain-node-link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    width: 0.5rem;
    height: 2px;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.8), rgba(245, 158, 11, 0.6));
    transform: translateY(-50%);
    z-index: 1;
}
.chain-node-link:last-child::after {
    display: none;
}

