/**
 * Dacks DND Tools – Alpha Version 0.2
 * Core Theme Stylesheet (Dark Fantasy Edition)
 *
 * This file handles the global visual identity of the toolkit, including:
 * 1. Design Tokens: Centralized colors and spacing via CSS variables.
 * 2. Typography: Themed headings and high-legibility body text.
 * 3. Component Styling: Skeuomorphic sections, buttons, and input fields.
 * 4. Animations: Subtle transitions for initiative turns and dice rolls.
 *
 * @package DacksDNDTools
 * @version 0.2.0
 */

/* SECTION 1: DESIGN TOKENS (ROOT VARIABLES)
   ========================================================================== */
:root {
    /* Primary Color Palette */
    --bg-main: #0f1113;        /* Deep Obsidian */
    --bg-panel: #1a1d21;       /* Dark Slate Gray */
    --accent-red: #c53030;     /* Blood Crimson */
    --accent-gold: #d4af37;    /* Antique Gold */
    --border-color: #2d3436;   /* Stone Border */

    /* Text Colors */
    --text-light: #e2e8f0;     /* Parchment White */
    --text-muted: #718096;     /* Fog Gray */

    /* Effects */
    --shadow-main: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --transition-speed: 0.3s;
}

/* SECTION 2: BASE STYLES & TYPOGRAPHY
   ========================================================================== */
body {
    background-color: var(--bg-main);
    color: var(--text-light);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    margin: 0;
    overflow-x: hidden;
}

/* Decorative Title Font for TTRPG flavor */
.title-font {
    font-family: 'Cinzel', serif; /* Falling back to serif if Cinzel is not loaded */
    letter-spacing: 0.05em;
}

h1, h2, h3, h4 {
    color: var(--text-light);
    line-height: 1.2;
}

a {
    color: var(--accent-gold);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--accent-red);
}

/* SECTION 3: COMPONENT STYLING (THEMED SECTIONS)
   ========================================================================== */
.section {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-main);
    transition: border-color var(--transition-speed);
}

/* Input & Select Styling */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 0.75rem;
    border-radius: 0.375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
    border-color: var(--accent-red) !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(197, 48, 48, 0.2);
}

/* SECTION 4: BUTTONS & ACTIONS
   ========================================================================== */
.action-button {
    background-color: var(--accent-red);
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    text-align: center;
}

.action-button:hover {
    background-color: #a72828;
}

.action-button:active {
    transform: scale(0.98);
}

.action-button-secondary {
    background-color: transparent;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
}

.action-button-secondary:hover {
    background-color: var(--accent-gold);
    color: var(--bg-main);
}

/* SECTION 5: SPECIALIZED TTRPG UI (DICE & TRACKERS)
   ========================================================================== */
/* Dice Buttons in the Rolling Tray */
.dice-btn i {
    filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.3));
}

/* Active Turn Highlight in Initiative Tracker */
.active-tab, .active-turn {
    border-left-color: var(--accent-red) !important;
    background-color: rgba(197, 48, 48, 0.05);
}

/* Custom Scrollbar for the Dark Theme */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* SECTION 6: ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.shake-animation {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}
