/* ===================================
   Daggerheart Custom Theme for daisyUI
   =================================== */

/* Custom Daggerheart Theme */
[data-theme="daggerheart"] {
    /* Primary - Gold accent */
    --color-primary: #d7a964;
    --color-primary-content: #1e293b;

    /* Secondary - Teal/cyan */
    --color-secondary: #83cdc2;
    --color-secondary-content: #160942;

    /* Accent - Bright cyan */
    --color-accent: #05c9d6;
    --color-accent-content: #160942;

    /* Neutral - Dark slate */
    --color-neutral: #1e293b;
    --color-neutral-content: #f9fafb;

    /* Base colours - Dark warm tones for tavern bg */
    --color-base-100: #1a1614;
    --color-base-200: #13110f;
    --color-base-300: #0d0b0a;
    --color-base-content: #f9fafb;

    /* Status colours */
    --color-info: #05c9d6;
    --color-info-content: #160942;
    --color-success: #83cdc2;
    --color-success-content: #160942;
    --color-warning: #e7c74b;
    --color-warning-content: #1e293b;
    --color-error: #ff6b6b;
    --color-error-content: #1e293b;

    /* Border radius */
    --radius-box: 0.5rem;
    --radius-btn: 0.375rem;
    --radius-badge: 0.25rem;
}

/* ===================================
   Typography
   =================================== */

/* Fantasy heading font */
.font-heading {
    font-family: 'Cinzel', 'Palatino Linotype', 'Book Antiqua', serif;
}

/* Logo/wordmark font */
.font-logo {
    font-family: 'Eagle Lake', serif !important;
}

/* Body font */
.font-body {
    font-family: 'Barlow', 'Segoe UI', system-ui, sans-serif;
}

/* Apply to rulebook */
[data-theme="daggerheart"] {
    font-family: 'Barlow', 'Segoe UI', system-ui, sans-serif;
}

/* ===================================
   Background & Layout
   =================================== */

/* Body with tavern background */
.rulebook-body {
    margin: 0;
    background-color: #0b0a08;
    background-image: url('../images/tavern_rules_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
}

/* iOS/Safari fixed background fix */
@media (max-width: 900px) {
    .rulebook-body {
        background-attachment: scroll;
    }
}

/* Main layout container - translucent over tavern */
.rules-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    background: rgba(26, 22, 20, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-left: 1px solid rgba(215, 169, 100, 0.2);
    border-right: 1px solid rgba(215, 169, 100, 0.2);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
}

/* ===================================
   Sidebar
   =================================== */

.rules-sidebar {
    width: 280px;
    flex-shrink: 0;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(19, 17, 15, 0.98) 0%, rgba(13, 11, 10, 0.98) 100%);
    border-right: 1px solid rgba(215, 169, 100, 0.3);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(215, 169, 100, 0.4) transparent;
}

.rules-sidebar::-webkit-scrollbar {
    width: 6px;
}

.rules-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.rules-sidebar::-webkit-scrollbar-thumb {
    background: rgba(215, 169, 100, 0.4);
    border-radius: 3px;
}

.rules-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(215, 169, 100, 0.6);
}

/* Sidebar title */
.sidebar-title {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #d7a964;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(215, 169, 100, 0.5);
}


/* Section divider in sidebar */
.sidebar-divider {
    border: none;
    border-top: 1px solid rgba(215, 169, 100, 0.2);
    margin: 1rem 0;
}

.sidebar-section-title {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: rgba(249, 250, 251, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem;
}

/* ===================================
   Navigation Menu Styles
   =================================== */

/* Override daisyUI menu for sidebar */
.rules-sidebar .menu {
    padding: 0;
    gap: 0.125rem;
}

.rules-sidebar .menu li > a,
.rules-sidebar .menu li > span {
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    border-left: 3px solid transparent;
    color: rgba(249, 250, 251, 0.75);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.rules-sidebar .menu li > a:hover {
    background: rgba(215, 169, 100, 0.1);
    border-left-color: rgba(215, 169, 100, 0.5);
    color: #f9fafb;
}

.rules-sidebar .menu li > a.menu-active,
.rules-sidebar .menu li > a.active {
    background: rgba(215, 169, 100, 0.15);
    border-left-color: #d7a964;
    color: #d7a964;
    font-weight: 600;
}

/* Nested menu items */
.rules-sidebar .menu ul {
    padding-left: 0.75rem;
    margin: 0.25rem 0;
}

.rules-sidebar .menu ul li > a {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    color: rgba(249, 250, 251, 0.6);
}

.rules-sidebar .menu ul li > a:hover {
    color: rgba(249, 250, 251, 0.9);
}

/* ===================================
   Main Content Area
   =================================== */

.rules-content {
    flex: 1;
    padding: 2rem 3rem;
    max-width: 900px;
    min-width: 0;
}

/* ===================================
   Breadcrumbs (DaisyUI component)
   =================================== */

/* Style the breadcrumb separators - override DaisyUI */
.breadcrumbs ul li + li::before {
    color: rgba(215, 169, 100, 0.6) !important;
    opacity: 1 !important;
}

/* ===================================
   Content Typography (Prose)
   =================================== */

.rules-prose {
    color: #f9fafb;
    line-height: 1.75;
}

/* Headings */
.rules-prose h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: #f9fafb;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #d7a964;
    position: relative;
}

.rules-prose h1::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: #d7a964;
    box-shadow: 0 0 15px #d7a964, 0 0 30px rgba(215, 169, 100, 0.3);
}

.rules-prose h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: #f0c75e;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(215, 169, 100, 0.4);
}

.rules-prose h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.375rem;
    font-weight: 600;
    color: #f9fafb;
    margin: 2rem 0 0.75rem;
}

.rules-prose h4 {
    font-family: 'Cinzel', serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: rgba(249, 250, 251, 0.85);
    margin: 1.5rem 0 0.5rem;
}

/* Paragraphs */
.rules-prose p {
    margin: 0 0 1rem;
}

/* Strong/bold text - gold highlight */
.rules-prose strong {
    color: #d7a964;
    font-weight: 600;
}

/* Emphasis */
.rules-prose em {
    color: rgba(249, 250, 251, 0.85);
}

/* Links */
.rules-prose a {
    color: #83cdc2;
    text-decoration: none;
    transition: color 0.15s ease;
}

.rules-prose a:hover {
    color: #05c9d6;
    text-decoration: underline;
}

/* ===================================
   Lists
   =================================== */

.rules-prose ul,
.rules-prose ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.rules-prose li {
    margin: 0.375rem 0;
}

.rules-prose ul li::marker {
    color: #d7a964;
}

.rules-prose ol li::marker {
    color: #d7a964;
    font-weight: 600;
}

/* ===================================
   Tables
   =================================== */

.rules-prose table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5rem 0;
    background: rgba(13, 11, 10, 0.8);
    border: 1px solid rgba(215, 169, 100, 0.3);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.rules-prose th {
    background: linear-gradient(180deg, rgba(37, 34, 32, 0.9) 0%, rgba(26, 22, 20, 0.9) 100%);
    color: #d7a964;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 2px solid rgba(215, 169, 100, 0.4);
}

.rules-prose td {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid rgba(215, 169, 100, 0.1);
    font-size: 0.9rem;
}

.rules-prose tr:last-child td {
    border-bottom: none;
}

.rules-prose tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.rules-prose tr:hover {
    background: rgba(215, 169, 100, 0.08);
}

/* First column emphasis */
.rules-prose td:first-child {
    font-weight: 600;
    color: #f9fafb;
}

/* ===================================
   Blockquotes
   =================================== */

.rules-prose blockquote {
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(131, 205, 194, 0.1) 0%, rgba(19, 17, 15, 0.9) 100%);
    border-left: 4px solid #83cdc2;
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
    color: rgba(249, 250, 251, 0.85);
    position: relative;
}

.rules-prose blockquote::before {
    content: '\201C';
    position: absolute;
    top: -10px;
    left: 15px;
    font-size: 3rem;
    font-family: 'Cinzel', serif;
    color: rgba(131, 205, 194, 0.3);
    line-height: 1;
}

.rules-prose blockquote p:last-child {
    margin-bottom: 0;
}

/* ===================================
   Code
   =================================== */

.rules-prose code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
    background: rgba(37, 34, 32, 0.8);
    color: #f0c75e;
    padding: 0.15em 0.4em;
    border-radius: 0.25rem;
    border: 1px solid rgba(215, 169, 100, 0.2);
}

.rules-prose pre {
    background: rgba(13, 11, 10, 0.9);
    border: 1px solid rgba(215, 169, 100, 0.3);
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.rules-prose pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    color: #f9fafb;
}

/* ===================================
   Horizontal Rules
   =================================== */

.rules-prose hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(215, 169, 100, 0.3) 20%, #d7a964 50%, rgba(215, 169, 100, 0.3) 80%, transparent 100%);
    margin: 2.5rem 0;
}

/* ===================================
   Index Page - Section Cards
   =================================== */

.rules-index {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.rules-index-title {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    font-weight: 700;
    color: #f9fafb;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
    margin-bottom: 0.75rem;
    text-shadow: 0 0 30px rgba(215, 169, 100, 0.3);
}

.rules-index-subtitle {
    text-align: center;
    color: rgba(249, 250, 251, 0.7);
    font-size: 1.125rem;
    margin-bottom: 3rem;
}

.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Section card styling */
.section-card {
    display: block;
    text-decoration: none;
    color: #f9fafb;
    background: linear-gradient(145deg, rgba(37, 34, 32, 0.9) 0%, rgba(26, 22, 20, 0.9) 100%);
    border: 1px solid rgba(215, 169, 100, 0.3);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.section-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(215, 169, 100, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.section-card:hover {
    border-color: #d7a964;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(215, 169, 100, 0.15);
}

.section-card:hover::before {
    opacity: 1;
}

.section-card .badge {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    background: transparent;
    color: rgba(215, 169, 100, 0.7);
    border: 1px solid rgba(215, 169, 100, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

.section-card h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #f9fafb;
    margin: 0;
    position: relative;
    z-index: 1;
    transition: color 0.15s ease;
}

.section-card:hover h2 {
    color: #d7a964;
}

/* ===================================
   Page List (Section pages)
   =================================== */

.page-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.page-list > li {
    margin: 1rem 0;
}

.page-list h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.125rem;
    color: #d7a964;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(215, 169, 100, 0.2);
}

.page-list > li > a {
    color: #f9fafb;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.15s ease;
    display: block;
    padding: 0.25rem 0;
}

.page-list > li > a:hover {
    color: #d7a964;
}

.page-list ul {
    list-style: none;
    padding-left: 1.25rem;
    margin: 0.5rem 0;
}

.page-list ul li {
    margin: 0.25rem 0;
    position: relative;
    padding-left: 1rem;
}

.page-list ul li::before {
    content: '\203A';
    position: absolute;
    left: 0;
    color: rgba(215, 169, 100, 0.5);
}

.page-list ul li a {
    color: rgba(249, 250, 251, 0.8);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.15s ease;
}

.page-list ul li a:hover {
    color: #d7a964;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 1024px) {
    .rules-sidebar {
        width: 240px;
    }

    .rules-content {
        padding: 1.5rem 2rem;
    }

    .rules-prose h1 {
        font-size: 1.875rem;
    }

    .rules-index-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .rules-layout {
        flex-direction: column;
    }

    .rules-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid rgba(215, 169, 100, 0.3);
        max-height: 50vh;
    }

    .rules-content {
        padding: 1.5rem;
    }

    .rules-prose h1 {
        font-size: 1.5rem;
    }

    .rules-prose h2 {
        font-size: 1.375rem;
    }

    .rules-prose table {
        font-size: 0.8rem;
    }

    .rules-prose th,
    .rules-prose td {
        padding: 0.5rem 0.625rem;
    }

    .sections-grid {
        grid-template-columns: 1fr;
    }

    .rules-index-title {
        font-size: 2rem;
    }

    .rules-index {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    .rules-prose table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .rules-index-title {
        font-size: 1.75rem;
        letter-spacing: 0.05em;
    }
}

/* ===================================
   Navbar
   =================================== */

.navbar {
    font-family: 'Barlow', sans-serif;
}

.navbar .menu a {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-base-content);
    transition: color 0.15s ease;
}

.navbar .menu a:hover,
.navbar .menu a.active {
    color: var(--color-primary);
    background: transparent;
}

/* Mobile dropdown menu */
.navbar .dropdown-content a {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Search input styling */
.navbar input[type="text"] {
    background: rgba(13, 11, 10, 0.6);
    border-color: rgba(215, 169, 100, 0.3);
}

.navbar input[type="text"]:focus {
    border-color: var(--color-primary);
    outline: none;
}

.navbar input[type="text"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
