@import url('https://fonts.googleapis.com/css2?family=Zen+Dots&display=swap');

/* --- Global Variables --- */
:root {
    --bg-color: #0b0d17;
    --card-bg: #151928;
    --text-color: #e0e6f3;
    --accent-color: #00f0ff;
    --accent-hover: #4efffe;
    --shadow-glow: 0 0 8px rgba(0, 240, 255, 0.4);
    --shadow-glow-hover: 0 0 15px rgba(78, 255, 254, 0.8), 0 0 25px rgba(78, 255, 254, 0.4);
    --border-radius: 8px;
}

/* --- Dark Theme --- */
.dark-theme {
    /* The dark theme is now the default, but these variables can still be used for a different dark mode if needed. */
    --bg-color: #0b0d17;
    --card-bg: #151928;
    --text-color: #e0e6f3;
    --accent-color: #00f0ff;
    --accent-hover: #4efffe;
    --shadow-glow: 0 0 8px rgba(0, 240, 255, 0.4);
    --shadow-glow-hover: 0 0 15px rgba(78, 255, 254, 0.8), 0 0 25px rgba(78, 255, 254, 0.4);
}

/* --- Base Body and Layout --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Zen Dots', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    background-image: url('/images/starfield.svg');
    background-repeat: repeat;
    background-attachment: fixed;
}


.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    padding: 40px 20px;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-family: 'Zen Dots', sans-serif;

    font-weight: 700;
    margin-bottom: 10px;
    color: var(--accent-color);
    text-shadow: 0 0 5px var(--accent-color);
    letter-spacing: 2px;
}

/* --- Theme Toggle Button --- */
.theme-toggle-btn {
    background: var(--card-bg);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 8px 15px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: absolute;
    top: 20px;
    right: 20px;
    box-shadow: var(--shadow-glow);
}

.theme-toggle-btn:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
    box-shadow: var(--shadow-glow-hover);
}

/* --- Card Grid Layout (for the hub page) --- */
.card-grid {
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    margin-bottom: 40px;
}

.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-glow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    position: relative;
    border: 1px solid var(--accent-color);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-glow-hover);
    border-color: var(--accent-hover);
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.card-content {
    padding: 20px;
    text-align: center;
}

.card-content h3 {
    font-size: 1.2rem;
    margin: 0;
    color: var(--text-color);
}

/* --- Calendar Section --- */
.calendar-section {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-glow);
    padding: 20px;
    text-align: center;
    border: 1px solid var(--accent-color);
}

.calendar-section h2 {
    margin-bottom: 20px;
}

.calendar-container {
    width: 100%;
    height: 600px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.calendar-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* --- Form and Button Styles (for the mission generator page) --- */
form {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-glow);
    border: 1px solid var(--accent-color);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--accent-color);
    text-shadow: 0 0 3px var(--accent-color);
}

input[type="text"],
textarea,
select,
input[type="range"] {
    width: 100%;
    padding: 20px;
    gap: 20px;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
textarea:focus,
select:focus,
input[type="range"]:focus {
    outline: none;
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-glow-hover);
}

/* --- Buttons --- */
.button-group {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    padding: 20px;
    flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.add-button {
    padding: 12px 20px;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 3px var(--accent-color);
    box-shadow: var(--shadow-glow);
}

.primary-button {
    background-color: var(--accent-color);
    color: var(--bg-color);
    text-shadow: none;
}

.primary-button:hover {
    background-color: var(--accent-hover);
    box-shadow: var(--shadow-glow-hover);
}

.secondary-button {
    background-color: #2c334a;
    color: var(--text-color);
}

.secondary-button:hover {
    background-color: #4a5472;
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-glow-hover);
}

.add-button {
    background-color: #084c2a;
    color: #a4f9b8;
    border-color: #21d054;
    text-shadow: 0 0 3px #21d054;
}

.add-button:hover {
    background-color: #1a6d36;
    border-color: #21d054;
    box-shadow: 0 0 15px rgba(33, 208, 84, 0.8);
}

/* --- Generated JSON Output --- */
.generated-output {
    margin-top: 40px;
}

.generated-output h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

#generatedJson {
    background-color: var(--card-bg);
    border: 1px solid var(--accent-color);
    padding: 20px;
    border-radius: var(--border-radius);
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', Courier, monospace;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow-glow);
}

/* Dark theme specific styles for the form */
.dark-theme form,
.dark-theme #generatedJson {
    background-color: var(--card-bg);
    border-color: var(--accent-color);
}

.dark-theme input[type="text"],
.dark-theme textarea,
.dark-theme select,
.dark-theme input[type="range"] {
    background-color: #151928;
    border-color: var(--accent-color);
}

.dark-theme input[type="text"]:focus,
.dark-theme textarea:focus,
.dark-theme select:focus,
.dark-theme input[type="range"]:focus {
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-glow-hover);
}

.dark-theme .primary-button {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

/* --- Mission Generator Specific Styles --- */
.characterForm .nav-point-section {
    margin-bottom: 25px;
    padding: 20px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-glow);
    border: 1px solid var(--accent-color);
}

.encounter-group {
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    background-color: #1a2034;
    border-left: 3px solid var(--accent-color);
    border-radius: var(--border-radius);
}

.form-fieldset {
    border: none;
    padding: 20px;
}

.form-fieldset legend {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 15px;
    padding: 20px;

}