/* General Styles */
body {
    font-family: "Roboto", Arial, sans-serif;
    background-color: #0a0a0a;
    color: #e0e0e0;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-image: url("DnD-background.webp");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: rgba(20, 20, 20, 0.9);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.2);
}

h1,
h2,
h3,
h4 {
    color: #ffa500;
    text-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
}

h1 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 30px;
}

#sticky-nav {
    position: sticky;
    top: 0;
    background-color: rgba(20, 20, 20, 0.9);
    z-index: 1000;
    padding: 10px 0;
}

/* Navigation */
#progress-bar {
    position: -webkit-sticky; /* For Safari */
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center; /* Ensures vertical alignment */
    margin-bottom: 10px;
    background-color: #2a2a2a;
    border-radius: 5px;
    overflow: hidden;
    padding: 10px;
}

#progress-bar .steps-container {
    display: flex;
    flex-grow: 1;
}

#progress-bar .step {
    margin-right: 10px;
    padding: 10px;
    text-align: center;
    color: #fff;
}

#search-bar {
    display: flex;
    align-items: center;
}

#search-bar input {
    padding: 5px;
    border: 1px solid #8b4513;
    border-radius: 3px;
    margin-right: 5px;
}

#search-bar button {
    padding: 5px 10px;
    background-color: #8b4513;
    color: #fff;
    border: none;
    border-radius: 3px;
}





.step {
    flex: 1;
    padding: 10px;
    text-align: center;
    background-color: #3a3a3a;
    color: #888;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.step.active {
    background-color: #8b4513;
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 69, 0, 0.5);
}

/* Content Sections */
.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

.dnd-box {
    background-color: rgba(139, 69, 19, 0.2);
    border: 1px solid #8b4513;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(255, 69, 0, 0.1);
}

/* Form Elements */
input,
select,
button,
textarea {
    background-color: #3a3a3a;
    border: 1px solid #8b4513;
    color: #e0e0e0;
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 10px;
}

button {
    background-color: #8b4513;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #a0522d;
}

/* Initiative Tracker */
#initiative-list {
    list-style-type: none;
    padding: 0;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th,
td {
    border: 1px solid #8b4513;
    padding: 8px;
    text-align: left;
}

/* Class Selector for Spell Slots */
#class-select { 
    background-color: #3a3a3a;
    border: 1px solid #8b4513;
    color: #e0e0e0;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
}

/* Spell Slots Table */
#spell-slots-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#spell-slots-table th,
#spell-slots-table td {
    border: 1px solid #8b4513;
    padding: 8px;
    text-align: center;
}


th {
    background-color: #8b4513;
    color: #fff;
}

.initiative-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background-color: rgba(139, 69, 19, 0.1);
    border-radius: 4px;
}

.initiative-item.current-turn {
    background-color: rgba(255, 165, 0, 0.2);
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
}

.initiative-item.start-of-round,
.initiative-item.end-of-round {
    background-color: rgba(0, 128, 0, 0.2);
    font-weight: bold;
}

.hp-input {
    width: 50px;
    margin: 0 5px;
}

/* Effect Timer */
#active-effects {
    list-style-type: none;
    padding: 0;
}

#active-effects li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

/* Spell Search */
#spell-result {
    margin-top: 10px;
}

/* Condition Tracker */
#active-conditions {
    margin-top: 10px;
}

/* NPC Generator */
#npc-result {
    margin-top: 10px;
}

/* Loot Generator */
#loot-result,
#treasure-result {
    margin-top: 10px;
}

/* Dice Roller */
#dice-result {
    margin-top: 10px;
    font-weight: bold;
}

/* CR Calculator */
#cr-result {
    margin-top: 10px;
    font-weight: bold;
}

/* Encounter Builder */
#monster-list {
    margin-top: 10px;
}

#encounter-difficulty {
    margin-top: 10px;
    font-weight: bold;
}

/* Random Generator */
#random-result {
    margin-top: 10px;
    font-style: italic;
}

/* Session Notes */
#session-notes,
#custom-rules-text {
    width: 100%;
    height: 150px;
    resize: vertical;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #2a2a2a;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #8b4513;
    width: 80%;
    max-width: 600px;
    border-radius: 4px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #ffa500;
    text-decoration: none;
    cursor: pointer;
}

/* Game State Controls */
#game-state-controls {
    margin-top: 20px;
    padding: 10px;
    background-color: rgba(139, 69, 19, 0.2);
    border-radius: 4px;
}

#game-state-controls button,
#game-state-controls input[type="file"] {
    margin-right: 10px;
}



/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 10px;
    }

    #progress-bar {
        flex-wrap: wrap;
    }

    .step {
        flex-basis: 50%;
    }

    .initiative-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .initiative-item > * {
        margin-bottom: 5px;
    }

    .modal-content {
        width: 95%;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #2a2a2a;
}

::-webkit-scrollbar-thumb {
    background: #8b4513;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0522d;
}

/* Tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:before,
[data-tooltip]:after {
    position: absolute;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    background-color: #8b4513;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 5px 10px;
    width: 120px;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
}

[data-tooltip]:after {
    content: "";
    border-width: 5px;
    border-style: solid;
    border-color: #8b4513 transparent transparent transparent;
    bottom: 115%;
    left: 50%;
    margin-left: -5px;
}

[data-tooltip]:hover:before,
[data-tooltip]:hover:after {
    visibility: visible;
    opacity: 1;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Print Styles */
@media print {
    body {
        background: none;
        color: black;
    }

    .container {
        max-width: none;
        margin: 0;
        padding: 0;
        background: none;
        box-shadow: none;
    }

    .step-content {
        display: block;
    }

    button,
    input[type="button"],
    input[type="submit"] {
        display: none;
    }
}

/* Additional styles for Condition dropdown in Initiative Tracker */
#condition-dropdown {
    margin-left: 10px;
    background-color: #3a3a3a;
    border: 1px solid #8b4513;
    color: #e0e0e0;
    padding: 8px;
    border-radius: 4px;
}

/* Add some styles for Save/Load buttons */
#save-game,
#load-game {
    margin-top: 10px;
    margin-right: 5px;
    background-color: #8b4513;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
}

#save-game:hover,
#load-game:hover {
    background-color: #a0522d;
}
