/* =========================================
   COMPONENTS.CSS — VISUAL STYLING LAYER
   ========================================= */

/* ---------------------------
   HEADER STYLING
---------------------------- */
#site-header {
    background: rgba(20, 10, 0, 0.78);
    backdrop-filter: blur(3px);
    border-bottom: 1px solid rgba(255, 204, 102, 0.35);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.7);
}

#site-header h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.3rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ffe7b3;
    text-shadow: 0 0 10px rgba(255, 180, 80, 0.6);
}

/* ---------------------------
   SIDEBAR VISUALS
---------------------------- */
#sidebar {
    background: linear-gradient(
        145deg,
        rgba(10, 5, 0, 0.70),
        rgba(12, 6, 2, 0.68)
    );
    border-radius: 14px;
    border: 1px solid rgba(255, 204, 102, 0.35);
    box-shadow:
        0 0 18px rgba(0, 0, 0, 0.85),
        0 0 22px rgba(255, 140, 60, 0.18);
    backdrop-filter: blur(8px);
}

#sidebar .nav-title {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #ffdd99;
    border-bottom: 1px solid rgba(255, 204, 102, 0.35);
    padding-bottom: 6px;
}

#sidebar ul {
    list-style: none;
    margin-top: 8px;
}

#sidebar li {
    padding: 6px 0;
    cursor: pointer;
    transition:
        color 0.18s ease,
        transform 0.12s ease,
        text-shadow 0.18s ease;
    font-size: 0.96rem;
}

/* ---------------------------
   NAVIGATION STYLING
---------------------------- */

/* Base appearance for nav items */
#sidebar .nav-subsection,
#sidebar .nav-item,
#sidebar .nav-section.collapsible {
    color: #f3c98b;
    font-size: 0.86rem;
    opacity: 0.9;
    text-decoration: none;
    display: block;
    padding: 2px 0;
}

/* Prevent hover bubbling */
#sidebar li:hover {
    color: inherit;
    text-shadow: none;
    transform: none;
}

/* Hover for clickable items */
#sidebar .nav-item:hover,
#sidebar .nav-subsection:hover,
#sidebar .nav-section.collapsible:hover,
#sidebar a:hover {
    color: #ffcc66;
    text-shadow: 0 0 6px rgba(255, 180, 80, 0.7);
    transform: translateX(2px);
}

/* Active item */
#sidebar li.active {
    color: #ffdd88;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(255, 200, 120, 0.9);
}

/* Section headers */
.nav-section {
    margin-top: 14px;
    font-size: 0.8rem;
    opacity: 0.78;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #f3c98b;
    display: block;
    cursor: pointer;
    text-decoration: none;
}

.nav-section:hover {
    color: #ffcc66;
    text-shadow: 0 0 6px rgba(255, 180, 80, 0.7);
    transform: translateX(2px);
}

/* Subheadings */
.nav-subsection {
    margin-top: 6px;
    margin-left: 10px;
    font-size: 0.75rem;
    opacity: 0.65;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #e8cfa2;
    cursor: default;
}

/* Nested items */
.nav-item {
    margin-left: 22px;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Collapsible headers */
.collapsible {
    position: relative;
    cursor: pointer;
    padding-right: 18px;
}

/* Arrow indicator */
.collapsible::after {
    content: "▼";
    position: absolute;
    right: 0;
    top: 0;
    font-size: 0.7rem;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

/* Collapsed arrow */
.collapsible.collapsed::after {
    transform: rotate(-90deg);
}

/* Collapsible groups */
.nav-group {
    margin-left: 22px;
    display: block;
}

.nav-group.collapsed {
    display: none;
}

/* Sidebar links */
#sidebar a {
    color: #f3c98b;
    font-size: 0.86rem;
    text-decoration: none;
    opacity: 0.9;
    display: block;
    padding: 2px 0;
}

/* Fix for section headers that are also nav-items */
.nav-section.nav-item {
    padding-left: 0 !important;
    margin-left: 0 !important;
    text-indent: 0 !important;
}

/* ---------------------------
   CONTENT PANEL VISUALS
---------------------------- */
#content {
    background: radial-gradient(
        circle at top left,
        rgba(255, 180, 80, 0.22),
        rgba(5, 4, 3, 0.85)
    );
    border-radius: 16px;
    border: 1px solid rgba(255, 204, 102, 0.32);
    box-shadow:
        0 0 22px rgba(0, 0, 0, 0.85),
        0 0 26px rgba(255, 140, 60, 0.18);
    backdrop-filter: blur(8px);
    color: #f8eede;
}

#content h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    margin-bottom: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffe2a8;
    border-bottom: 1px solid rgba(255, 204, 102, 0.35);
    padding-bottom: 6px;
}

#content h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    margin: 14px 0 6px;
    letter-spacing: 0.06em;
    color: #ffd48a;
}

#content p,
#content li {
    line-height: 1.6;
    font-size: 0.98rem;
    color: #f3d9b1;
}

#content a {
    color: #ffcc7a;
    text-decoration: none;
    border-bottom: 1px dotted rgba(255, 204, 122, 0.7);
    transition: color 0.18s ease, border-color 0.18s ease;
}

#content a:hover {
    color: #ffe2a8;
    border-color: rgba(255, 230, 180, 0.9);
}

.welcome-closing {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    text-align: center;
    margin-top: 32px;
    color: #ffd48a !important;
    font-weight: 500;
    line-height: 1.6;
}

/* ---------------------------
   TABLE STYLING
---------------------------- */
.rpg-table {
    width: auto;
    border-collapse: collapse;
    margin-bottom: 20px;
    max-width: 100%;
    display: inline-table;
}

.rpg-table th,
.rpg-table td {
    border: 1px solid #444;
    padding: 6px 10px;
    text-align: center;
    vertical-align: middle;
    white-space: normal;
}

.rpg-table th {
    font-weight: bold;
    white-space: normal;
}

.paired-table th,
.paired-table td {
    width: 25%;
}

/* ---------------------------
   CALENDAR COMPONENTS
---------------------------- */
#calendar-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

#calendar-controls h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffe2a8;
}

.cal-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 204, 102, 0.55);
    padding: 7px 14px;
    color: inherit;
    cursor: pointer;
    border-radius: 999px;
    transition:
        background 0.18s ease,
        transform 0.1s ease,
        box-shadow 0.18s ease;
    font-size: 0.9rem;
}

.cal-btn:hover {
    background: rgba(255, 204, 102, 0.22);
    box-shadow: 0 0 10px rgba(255, 180, 80, 0.6);
    transform: translateY(-1px);
}

.calendar-wrapper {
    padding: 12px;
    border-radius: 14px;
    margin-bottom: 26px;
    background: linear-gradient(
        145deg,
        rgba(10, 5, 0, 0.55),
        rgba(12, 6, 2, 0.50)
    );
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    width: 100%;
}

.calendar-dow {
    font-weight: 600;
    text-align: center;
    padding: 8px 0;
    opacity: 0.96;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 8px;
    border: 1px solid rgba(255, 204, 102, 0.4);
    font-size: 0.9rem;
}

.calendar-day {
    padding: 8px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 204, 102, 0.32);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 70px;
    height: 12vw;
    max-height: 150px;
    backdrop-filter: blur(4px);
    overflow: hidden;
}

.calendar-day-header {
    font-weight: 600;
    font-size: 1rem;
    opacity: 0.95;
    color: #ffe2a8;
}

.calendar-event {
    font-size: 0.86rem;
    line-height: 1.3;
    margin-left: 2px;
    color: #fdf5e6;
}

.calendar-today {
    border: 2px solid #ffcc66 !important;
    background: rgba(255, 204, 102, 0.18);
    box-shadow: 0 0 10px rgba(255, 204, 102, 0.6);
}

/* ---------------------------
   CUSTOM SCROLLBARS
---------------------------- */

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 180, 80, 0.45) rgba(20, 10, 0, 0.35);
}

/* Chrome, Edge, Safari */
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: rgba(20, 10, 0, 0.35);
    border-radius: 10px;
    backdrop-filter: blur(3px);
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        rgba(255, 180, 80, 0.55),
        rgba(255, 140, 60, 0.45)
    );
    border-radius: 10px;
    border: 1px solid rgba(255, 204, 102, 0.35);
    box-shadow: 0 0 6px rgba(255, 180, 80, 0.4);
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        rgba(255, 200, 120, 0.75),
        rgba(255, 160, 80, 0.65)
    );
    box-shadow: 0 0 8px rgba(255, 200, 120, 0.6);
}
