/* Global styles extracted from templates/index.html */

/* Color Palette Variables */
:root {
    /* Primary color (Gold/Orange tones) */
    --primary-1: #A46E11;
    --primary-2: #9B630A;
    --primary-3: #915D03;
    --primary-4: #873D00;
    --primary-5: #7C4E00;
        /* Primary RGB */
        --primary-1-rgb: rgb(164, 110, 17);
        --primary-2-rgb: rgb(155, 99, 10);
        --primary-3-rgb: rgb(145, 93, 3);
        --primary-4-rgb: rgb(135, 61, 0);
        --primary-5-rgb: rgb(124, 78, 0);
    
    /* Secondary color #1 (Teal/Cyan tones) */
    --secondary-1-1: #0F4E67;
    --secondary-1-2: #0A4961;
    --secondary-1-3: #064358;
    --secondary-1-4: #033E55;
    --secondary-1-5: #03394E;
        /* Secondary-1 RGB */
        --secondary-1-1-rgb: rgb(15, 78, 103);
        --secondary-1-2-rgb: rgb(10, 73, 97);
        --secondary-1-3-rgb: rgb(6, 67, 88);
        --secondary-1-4-rgb: rgb(3, 62, 85);
        --secondary-1-5-rgb: rgb(3, 57, 78);
    
    /* Secondary color #2 (Orange/Brown tones) */
    --secondary-2-1: #A45D11;
    --secondary-2-2: #9B550A;
    --secondary-2-3: #914D03;
    --secondary-2-4: #874600;
    --secondary-2-5: #7C4100;
        /* Secondary-2 RGB */
        --secondary-2-1-rgb: rgb(164, 93, 17);
        --secondary-2-2-rgb: rgb(155, 85, 10);
        --secondary-2-3-rgb: rgb(145, 77, 3);
        --secondary-2-4-rgb: rgb(135, 70, 0);
        --secondary-2-5-rgb: rgb(124, 65, 0);
    
    /* Complement color (Blue tones) */
    --complement-1: #14386C;
    --complement-2: #0F3266;
    --complement-3: #0B2D60;
    --complement-4: #082859;
    --complement-5: #062552;
        /* Complement RGB */
        --complement-1-rgb: rgb(20, 56, 108);
        --complement-2-rgb: rgb(15, 50, 102);
        --complement-3-rgb: rgb(11, 45, 96);
        --complement-4-rgb: rgb(8, 40, 89);
        --complement-5-rgb: rgb(6, 37, 82);
    
    /* Modal specific */
    --modal-bg: var(--gray-dark);
    --modal-border: var(--secondary-1-3);
    --modal-text: #f3f4f6;
    --modal-text-muted: #9ca3af;
    --modal-title: var(--secondary-1-1);
    --modal-input-bg: var(--gray-medium);
    --modal-input-border: var(--secondary-2-4);
    --modal-btn-primary-bg: var(--primary-1);
    --modal-btn-primary-hover: var(--primary-2);
    --modal-btn-secondary-bg: var(--secondary-2-3);
    --modal-btn-secondary-hover: var(--secondary-2-2);
    --modal-btn-danger-bg: #8B2635;
    --modal-accent: var(--secondary-1-1);
    /* Gray backgrounds */
    --gray-darker: #1a1a1a;
    --gray-dark: #252525;
    --gray-medium: #303030;
    --gray-light: #3a3a3a;
    --gray-lighter: #454545;
        /* Gray RGBs */
        --gray-darker-rgb: rgb(26, 26, 26);
        --gray-dark-rgb: rgb(37, 37, 37);
        --gray-medium-rgb: rgb(48, 48, 48);
        --gray-light-rgb: rgb(58, 58, 58);
        --gray-lighter-rgb: rgb(69, 69, 69);
}

html, body, .hero, .hero-body { height: 100%; margin: 0; padding: 0; }
.hero-body { display: flex; justify-content: center; align-items: center; position: relative; }
#container { background: var(--gray-darker); width: 100%; height: 100%; }

/* Context Menu Styles */
#context-menu { display: none; position: absolute; background-color: white; border: 1px solid #ccc; z-index: 100; }
#context-menu a { display: block; padding: 8px 15px; cursor: pointer; color: black; text-decoration: none; }
#context-menu a:hover { background-color: #eee; }

/* ===== Unified Modal Styles ===== */
.unified-modal .box {
    background: var(--modal-bg);
    border: 1px solid var(--modal-border);
    color: var(--modal-text);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.unified-modal .modal-title {
    color: var(--modal-title);
    font-weight: 600;
    margin-bottom: 1rem;
    cursor: grab;
    user-select: none;
}

.unified-modal .modal-title:active {
    cursor: grabbing;
}

.unified-modal .label {
    color: var(--modal-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.unified-modal .input,
.unified-modal .textarea,
.unified-modal .select select {
    background: var(--modal-input-bg);
    border-color: var(--modal-input-border);
    color: var(--modal-text);
}

.unified-modal .input:focus,
.unified-modal .textarea:focus,
.unified-modal .select select:focus {
    border-color: var(--modal-accent);
    box-shadow: 0 0 0 2px rgba(166, 99, 6, 0.2);
}

.unified-modal .input::placeholder,
.unified-modal .textarea::placeholder {
    color: var(--modal-text-muted);
}

.unified-modal .button.is-primary {
    background: var(--modal-btn-primary-bg);
    border-color: transparent;
    color: white;
}

.unified-modal .button.is-primary:hover {
    background: var(--modal-btn-primary-hover);
}

.unified-modal .button.is-info {
    background: var(--secondary-2-1);
    border-color: transparent;
    color: white;
}

.unified-modal .button.is-info:hover {
    background: var(--secondary-2-2);
}

.unified-modal .button.is-danger {
    background: var(--modal-btn-danger-bg);
    border-color: transparent;
    color: white;
}

.unified-modal .button:not(.is-primary):not(.is-info):not(.is-danger):not(.is-light) {
    background: var(--modal-btn-secondary-bg);
    border-color: transparent;
    color: var(--modal-text);
}

.unified-modal .button:not(.is-primary):not(.is-info):not(.is-danger):not(.is-light):hover {
    background: var(--modal-btn-secondary-hover);
}

.unified-modal .button.is-light {
    background: var(--gray-medium);
    border-color: var(--modal-input-border);
    color: var(--modal-text);
}

.unified-modal .button.is-light:hover {
    background: var(--gray-light);
}

.unified-modal .help {
    color: var(--modal-text-muted);
}

.unified-modal .heading {
    color: var(--modal-text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.unified-modal .tag.is-info {
    background: var(--secondary-2-1);
    color: white;
}

.unified-modal .checkbox {
    color: var(--modal-text);
}

/* Quick dice buttons style */
.unified-modal .dice-quick-btn {
    background: var(--gray-medium) !important;
    border: 1px solid var(--modal-input-border) !important;
    color: var(--modal-text) !important;
    font-weight: bold;
}

.unified-modal .dice-quick-btn:hover {
    background: var(--gray-light) !important;
    border-color: var(--modal-accent) !important;
}

/* Dice result styling */
.unified-modal .dice-result {
    font-size: 3rem;
    font-weight: bold;
    text-align: center;
    color: var(--modal-title);
    min-height: 4rem;
}

.unified-modal .dice-details {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--modal-text-muted);
}

.unified-modal .dice-history {
    background: var(--gray-darker);
    padding: 0.75rem;
    border-radius: 0.5rem;
    max-height: 120px;
    overflow-y: auto;
    font-size: 0.875rem;
    list-style: none;
    margin: 0;
}

.unified-modal .dice-history li {
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--modal-input-border);
}

/* Character grid in modal */
.unified-modal .character-option {
    background: var(--gray-medium);
    border: 2px solid var(--modal-input-border);
    color: var(--modal-text);
    margin-right: 16px;
}

.unified-modal .character-option:hover {
    border-color: var(--modal-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.unified-modal .character-info strong {
    color: var(--modal-text);
}

.unified-modal .character-size,
.unified-modal .character-desc {
    color: var(--modal-text-muted);
}

/* Nudge buttons */
.unified-modal .buttons.has-addons .button {
    background: var(--gray-medium);
    border-color: var(--modal-input-border);
    color: var(--modal-text);
}

.unified-modal .buttons.has-addons .button:hover {
    background: var(--gray-light);
    border-color: var(--modal-accent);
}

/* Main Menu Dropdown Styles */
#main-menu-dropdown {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

#main-menu-dropdown .dropdown-content {
    max-height: 80vh;
    overflow-y: auto;
}

.modal .title.is-4, .unified-modal .title.is-4 {
    color: var(--modal-title, #0F4E67);
    padding: 0;
    background: transparent;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile adjustments */
@media (max-width: 600px) {
    #main-menu-dropdown {
        top: 12px;
        right: 12px;
    }
}

.menu-item {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Tile Size Buttons */
.tile-size-option {
    padding: 8px 12px;
    margin: 4px 0;
    border: none;
    border-radius: 4px;
    background: #eee;
    color: #333;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}
.tile-size-option.active {
    background: #3273dc;
    color: white;
}

/* Character Selection Modal Styles */
.character-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

/* Modal content area with managed scrolling */
#character-modal-content {
    max-height: 70vh;
    overflow-y: auto;
}

.character-option {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid var(--modal-input-border, #ddd);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--gray-medium, white);
}

.character-option:hover {
    border-color: var(--modal-accent, #3273dc);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.character-preview {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin-right: 12px;
    flex-shrink: 0;
}

.character-info strong {
    display: block;
    margin-bottom: 4px;
    color: var(--modal-text, #333);
}

.character-size {
    font-size: 0.8em;
    color: var(--modal-text-muted, #666);
    margin-bottom: 2px;
}

.character-desc {
    font-size: 0.85em;
    color: var(--modal-text-muted, #777);
    font-style: italic;
}

/* Map Adjustment Modal Styles */
.map-adjust-controls {
    margin: 1rem 0;
}

.zoom-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.zoom-control input[type="range"] {
    flex: 1;
}

#zoom-value {
    min-width: 50px;
    font-weight: bold;
}

/* Dungeon Generator Modal Styles */
.dungeon-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.dungeon-control-group {
    display: flex;
    flex-direction: column;
}

.dungeon-control-group label {
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--modal-text-muted, #363636);
}

.dungeon-control-group input,
.dungeon-control-group select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.dungeon-preview {
    max-width: 100%;
    max-height: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 10px 0;
}

.modal-content .box {
    max-width: 800px;
    margin: 0 auto;
}

/* Example utility classes for colors */
.bg-primary-1 { background-color: var(--primary-1); }
.bg-primary-2 { background-color: var(--primary-2); }
.bg-primary-3 { background-color: var(--primary-3); }
.bg-primary-4 { background-color: var(--primary-4); }
.bg-primary-5 { background-color: var(--primary-5); }

.bg-secondary-1-1 { background-color: var(--secondary-1-1); }
.bg-secondary-1-2 { background-color: var(--secondary-1-2); }
.bg-secondary-1-3 { background-color: var(--secondary-1-3); }
.bg-secondary-1-4 { background-color: var(--secondary-1-4); }
.bg-secondary-1-5 { background-color: var(--secondary-1-5); }

.bg-secondary-2-1 { background-color: var(--secondary-2-1); }
.bg-secondary-2-2 { background-color: var(--secondary-2-2); }
.bg-secondary-2-3 { background-color: var(--secondary-2-3); }
.bg-secondary-2-4 { background-color: var(--secondary-2-4); }
.bg-secondary-2-5 { background-color: var(--secondary-2-5); }

.bg-complement-1 { background-color: var(--complement-1); }
.bg-complement-2 { background-color: var(--complement-2); }
.bg-complement-3 { background-color: var(--complement-3); }
.bg-complement-4 { background-color: var(--complement-4); }
.bg-complement-5 { background-color: var(--complement-5); }

.bg-gray-darker { background-color: var(--gray-darker); }
.bg-gray-dark { background-color: var(--gray-dark); }
.bg-gray-medium { background-color: var(--gray-medium); }
.bg-gray-light { background-color: var(--gray-light); }
.bg-gray-lighter { background-color: var(--gray-lighter); }

.text-primary-1 { color: var(--primary-1); }
.text-secondary-1-1 { color: var(--secondary-1-1); }
.text-secondary-2-1 { color: var(--secondary-2-1); }
.text-complement-1 { color: var(--complement-1); }

