/*
    Dack's DND Tools - Global Stylesheet
    ====================================
    This file defines the "dark fantasy" theme and layout for the entire website.
    This is the complete and final version containing all styles for all pages.
*/

/* SECTION: ROOT VARIABLES */
:root {
    --bg-main: #111111;
    --bg-panel: #1d1d1d;
    --border-color: #333;
    --text-light: #e2e2e2;
    --text-muted: #999;
    --accent-red: #9f1212;
    --accent-gold: #5c4b33;
}

/* SECTION: BODY & TYPOGRAPHY */
body {
    font-family: 'Merriweather', serif;
    background-color: #5e160c;
    background-image: url("https://www.transparenttextures.com/patterns/black-scales.png");
    color: var(--text-light);
    line-height: 1.7;
}

h1, h2, h3, h4, .title-font {
    font-family: 'Cinzel Decorative', serif;
    letter-spacing: 0.05em;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* SECTION: GENERAL LAYOUT & REUSABLE COMPONENTS */
.section {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.4);
}

.panel {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5), 0 4px 15px rgba(0,0,0,0.5);
}

a .section:hover, a .panel:hover {
    border-color: var(--accent-gold);
}

/* ACTION BUTTONS */
.action-button {
    background-color: var(--accent-red);
    color: white;
    border: 1px solid #d43a3a;
    border-radius: 0.375rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 0.5rem 1rem;
}
.action-button:hover {
    background-color: #bf1c1c;
}
.action-button:active {
    transform: translateY(1px);
    filter: brightness(0.9);
}
.action-button-secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-weight: 500;
    text-align: center;
    border-radius: 0.375rem;
    background-color: #333;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}
.action-button-secondary:hover {
    background-color: var(--accent-gold);
    color: var(--text-light);
}

/* FORM ELEMENTS */
input, textarea, select {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    color: var(--text-light);
    transition: all 0.2s ease;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(159, 18, 18, 0.2);
}
input:disabled, textarea:disabled, select:disabled {
    background-color: #2a2a2a;
    cursor: not-allowed;
}
label {
    display: block;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

/* SECTION: NAVIGATION */
nav {
    background-color: rgba(29, 29, 29, 0.8) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}
.nav-link {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.2s ease-in-out;
}
.nav-link:hover {
    background-color: var(--accent-gold);
    color: var(--text-light);
}
.active-nav {
    background-color: var(--accent-red);
    color: white !important;
}

.dropdown-content {
    background-color: #1a1a1a;
    border: 1px solid var(--border-color);
    min-width: 14rem;
}
.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
    font-weight: 700;
}
.dropdown-item:hover {
    background-color: var(--accent-gold);
    color: var(--text-light);
}
.dropdown .tools-dropdown-btn .fa-chevron-down {
    transition: transform 0.3s ease;
}
.dropdown:hover .tools-dropdown-btn .fa-chevron-down {
    transform: rotate(180deg);
}

.mobile-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-weight: 700;
    color: var(--text-muted);
}
.mobile-nav-link:hover{
    background-color: var(--accent-gold);
    color: var(--text-light);
}

/* SECTION: HOME PAGE */
.tool-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5), 0 4px 15px rgba(0,0,0,0.5);
    transition: all 0.3s ease-in-out;
}
.tool-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--accent-gold);
}

/* SECTION: CHARACTER SHEET */
.prof-check {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 9999px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    background-color: var(--bg-main);
}
.prof-check:hover {
    border-color: var(--accent-gold);
}
.prof-check:checked {
    background-color: var(--accent-red);
    border-color: #d43a3a;
}
.prof-check:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.5rem;
    height: 0.5rem;
    background-color: white;
    border-radius: 9999px;
    transform: translate(-50%, -50%);
}
.search-results-list {
    position: absolute;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    z-index: 10;
}
.search-results-list ul { list-style: none; padding: 0; margin: 0; }
.search-results-list button:hover { background-color: var(--accent-gold); }
.stat-view {
    background: transparent;
    border: none;
    border-bottom: 2px dotted var(--border-color);
    text-align: center;
    width: 4rem;
    padding: 0.25rem;
    border-radius: 0;
    font-weight: 700;
}
#character-sheet .ability-score {
    text-align: center;
    font-size: 1.875rem;
    font-weight: 700;
    background-color: #000;
    border-color: var(--border-color);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}
#character-sheet .ability-mod {
    text-align: center;
    font-size: 1.125rem;
    background-color: var(--bg-main);
    border: 2px solid var(--border-color);
    border-radius: 9999px;
    width: 4rem;
    margin: 0.5rem auto 0;
}
#character-sheet textarea {
    background-color: #2a2a2a;
    border-color: #444;
    resize: vertical;
    line-height: 1.6;
    font-family: 'Merriweather', serif;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
}
#character-sheet input[id^="ds-"] {
    transition: all 0.2s ease;
    cursor: pointer;
    width: 1.5rem;
    height: 1.5rem;
}
#character-sheet input[id^="ds-s"]:checked {
    background-color: #059669; /* A distinct green */
    border-color: #047857;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
}
#character-sheet input[id^="ds-f"]:checked {
    background-color: var(--accent-red);
    border-color: #d43a3a;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.7);
}
#custom-item-modal {
    position: fixed; inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 50; padding: 1rem;
}

/* SECTION: NOTIFICATION */
#notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-panel);
    color: var(--text-light);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s, visibility 0.5s;
    border: 1px solid var(--border-color);
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}
#notification.show {
    opacity: 1;
    visibility: visible;
}

/* SECTION: DICE ROLLER */
img.dice-btn {
    cursor: pointer;
    transition: transform 0.2s ease-in-out, filter 0.2s ease-in-out;
    border-radius: 0.5rem;
}
img.dice-btn:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}
.control-btn {
     background-color: #333;
     border: 1px solid var(--border-color);
     color: var(--text-light);
}
.control-btn:hover {
     background-color: #444;
}

/* SECTION: COMPENDIUM & TABS */
.sheet-tab {
    display: block;
    width: auto;
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 700;
    color: var(--text-muted);
    border-radius: 0.375rem 0.375rem 0 0;
    transition: all 0.2s ease-in-out;
    border: 2px solid transparent;
    border-bottom: none;
}
.sheet-tab:hover {
    background-color: var(--accent-gold);
    color: var(--text-light);
}
.active-sheet-tab {
    background-color: var(--bg-panel);
    border-color: var(--border-color);
    border-bottom-color: transparent;
    color: white !important;
}

/* SECTION: INITIATIVE TRACKER */
#initiative-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}
#initiative-list li.active-turn {
    background-color: var(--accent-gold);
    border-color: var(--accent-red);
}

/* SECTION: PAGINATION */
.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-panel);
    border-radius: 0.375rem;
    color: var(--text-muted);
    font-weight: bold;
    transition: all 0.2s ease;
}
.pagination-btn:hover {
    background-color: var(--accent-gold);
    color: var(--text-light);
    border-color: var(--accent-gold);
}
.pagination-btn.active-page {
    background-color: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
    cursor: default;
}
.pagination-ellipsis {
    padding: 0.5rem 0.25rem;
    color: var(--text-muted);
}

/* SECTION: ADMIN PANEL & SIDEBAR MENUS */
.admin-nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-muted);
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
    border-left: 4px solid transparent;
}
.admin-nav-link:hover {
    background-color: var(--accent-gold);
    color: var(--text-light);
    transform: translateX(4px);
}
.admin-nav-link.active {
    color: white;
    background-color: rgba(92, 75, 51, 0.5);
    border-left: 4px solid var(--accent-red);
}
.admin-nav-link .fa-fw {
    width: 1.25em;
    margin-right: 0.5rem;
}
#pages_admin_rev008 .section .panel {
    border-top: 3px solid var(--accent-red);
    transition: all 0.3s ease-in-out;
}
#pages_admin_rev008 .section .panel:hover {
    transform: translateY(-5px);
    border-color: var(--accent-gold);
    border-top-color: var(--accent-gold);
}

/* SECTION: FOOTER */
footer {
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    border-top: 2px solid var(--accent-red);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}
footer h5.title-font {
    color: var(--text-light);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}
footer nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem;
    margin: 0.125rem 0;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
    display: block;
    text-align: center;
}
footer nav a:hover {
    color: white;
    background-color: transparent;
    text-decoration: underline;
}
footer .social-icon {
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
}
footer .social-icon:hover {
    color: var(--accent-red);
    transform: translateY(-2px) scale(1.1);
}
