/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Garamond', 'Times New Roman', serif;
    line-height: 1.6;
    color: #e8d9b5;
    background-color: #1a1a1a;
    background-image: url('https://cdn.shopify.com/s/files/1/0878/9629/3713/files/backdrop.jpg?v=1740173064');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: rgba(15, 15, 25, 0.7);
    color: #e8d9b5;
    border-radius: 5px;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
}

h1, h2, h3 {
    margin-bottom: 15px;
    font-family: 'Garamond', 'Times New Roman', serif;
    font-weight: normal;
    letter-spacing: 1px;
    color: #e8d9b5;
}

h1 {
    font-size: 2.5em;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #d4af37; /* Gold color for main title */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

section {
    background-color: rgba(15, 15, 25, 0.7);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
    border: none;
}

button {
    padding: 8px 16px;
    background-color: rgba(30, 30, 45, 0.8);
    color: #e8d9b5;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.3s;
    font-family: 'Garamond', 'Times New Roman', serif;
    letter-spacing: 1px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

button:hover {
    background-color: rgba(40, 40, 60, 0.9);
    border-color: rgba(212, 175, 55, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
}

button:disabled {
    background-color: rgba(20, 20, 30, 0.5);
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Reset button styling */
.reset-button {
    background-color: rgba(139, 0, 0, 0.8); /* Dark red */
    color: #e8d9b5;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.reset-button:hover {
    background-color: rgba(165, 42, 42, 0.9); /* Darker red on hover */
    border-color: rgba(212, 175, 55, 0.6);
}

select, input {
    padding: 8px;
    margin: 5px 0;
    border: 1px solid rgba(155, 139, 111, 0.3);
    border-radius: 4px;
    width: 100%;
    font-family: 'Garamond', 'Times New Roman', serif;
    background-color: rgba(20, 20, 30, 0.7);
    color: #e8d9b5;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

select:focus, input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.6);
}

/* Player Background Section */
#players-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.player-select {
    padding: 10px;
    background-color: rgba(20, 20, 30, 0.5);
    border-radius: 5px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.controls {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Faction Standing Section */
.reputation-display {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.faction {
    flex: 1;
    min-width: 200px;
    text-align: center;
    border: none;
    padding: 15px;
    border-radius: 5px;
    background-color: rgba(20, 20, 30, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.faction h3 {
    background-color: rgba(30, 30, 45, 0.8);
    color: #e8d9b5;
    padding: 8px;
    margin: -15px -15px 15px -15px;
    border-radius: 5px 5px 0 0;
    font-weight: normal;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.reputation-meter {
    height: 40px;
    background-color: rgba(20, 20, 30, 0.7);
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
    border: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.meter-value {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-weight: bold;
    color: #e8d9b5;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Events Section */
.chapter-navigation {
    margin-bottom: 20px;
}

.event-card {
    background-color: rgba(20, 20, 30, 0.5);
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.event-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://www.transparenttextures.com/patterns/old-paper.png');
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

.event-title {
    font-weight: normal;
    margin-bottom: 10px;
    background-color: rgba(30, 30, 45, 0.8);
    color: #e8d9b5;
    padding: 8px;
    margin: -15px -15px 15px -15px;
    border-radius: 5px 5px 0 0;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    position: relative;
    z-index: 1;
}

.event-description {
    margin-bottom: 15px;
    padding: 10px;
    background-color: rgba(15, 15, 25, 0.6);
    border-radius: 5px;
    font-style: italic;
    border: none;
    color: #e8d9b5;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.event-choices {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.choice-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100%;
    margin-bottom: 0;
    padding-left: 0;
}

.choice-container input[type="checkbox"],
.choice-container input[type="radio"] {
    margin-right: 10px;
    margin-left: 0;
    vertical-align: middle;
}

.choice-container .choice-text {
    flex: 1;
    display: block;
    text-align: left;
    margin-left: 0;
    vertical-align: middle;
}

.choice-effects {
    font-size: 0.9em;
    color: #d4af37; /* Gold color for effects */
    margin-top: 5px;
    padding: 5px;
    background-color: rgba(15, 15, 25, 0.6);
    border-radius: 3px;
    border: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.complete-chapter-button {
    background-color: rgba(30, 30, 45, 0.8);
    font-weight: normal;
    padding: 12px 24px;
    margin-top: 20px;
    letter-spacing: 1px;
    border: 1px solid rgba(212, 175, 55, 0.4);
}

.complete-chapter-button:hover {
    background-color: rgba(40, 40, 60, 0.9);
    border-color: rgba(212, 175, 55, 0.7);
}

.chapter-title {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    font-size: 1.4em;
    font-weight: normal;
    color: #d4af37; /* Gold color for chapter title */
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.chapter-summary, .chapter-complete, .campaign-complete {
    background-color: rgba(20, 20, 30, 0.5);
    padding: 20px;
    border-radius: 5px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    color: #e8d9b5;
}

.reputation-changes, .current-reputation, .final-reputation {
    margin: 15px 0;
    padding: 10px;
    background-color: rgba(15, 15, 25, 0.6);
    border-radius: 5px;
    border: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.reputation-changes h4, .current-reputation h4, .final-reputation h4 {
    color: #d4af37; /* Gold color for headings */
    margin-bottom: 10px;
    font-weight: normal;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.reputation-changes ul, .current-reputation ul, .final-reputation ul {
    list-style-type: none;
    padding-left: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .reputation-display {
        flex-direction: column;
    }
    
    #players-container {
        grid-template-columns: 1fr;
    }
}

footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: #e8d9b5;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    font-style: italic;
    background-color: rgba(15, 15, 25, 0.7);
    border-radius: 5px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
}

/* Table styles */
.eldritch-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.eldritch-table th {
    background-color: rgba(30, 30, 45, 0.8);
    color: #e8d9b5;
    font-weight: normal;
    text-align: left;
    padding: 8px;
    border: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    letter-spacing: 1px;
}

.eldritch-table td {
    padding: 8px;
    border: none;
    border-bottom: 1px solid rgba(155, 139, 111, 0.1);
    background-color: rgba(20, 20, 30, 0.5);
    color: #e8d9b5;
}

.eldritch-table tr:nth-child(even) td {
    background-color: rgba(15, 15, 25, 0.6);
}

/* Color indicators */
.positive {
    color: #7fbf7f !important; /* Lighter green for dark background */
    font-weight: bold;
    text-shadow: 0 0 5px rgba(127, 191, 127, 0.3);
}

.negative {
    color: #ff6666 !important; /* Lighter red for dark background */
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 102, 102, 0.3);
}

.neutral {
    color: #e8d9b5 !important; /* Parchment color */
}

/* Additional styles for the subtitle */
.subtitle {
    font-style: italic;
    font-size: 1.2em;
    margin-top: -10px;
    color: #d4af37; /* Gold color for subtitle */
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Style for the new MonkeyDM subtitle */
.monkeydm-subtitle {
    font-style: italic;
    font-size: 1em; /* Slightly smaller than the other subtitle */
    margin-top: 5px; /* Adjust spacing as needed */
    color: #b08d57; /* A slightly different shade of gold, or parchment */
    opacity: 0.8;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.monkeydm-subtitle a {
    color: inherit; /* Inherit color from parent */
    text-decoration: underline; /* Always underline */
}

.monkeydm-subtitle a:hover {
    /* text-decoration: underline; Underline on hover for better UX - Already underlined */
    color: #d4af37; /* Brighter gold on hover */
}

/* Custom radio and checkbox buttons to match the theme */
input[type="radio"],
input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px !important;
    height: 16px !important;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 50%; /* Make both circular */
    outline: none;
    background-color: rgba(20, 20, 30, 0.7);
    cursor: pointer;
    position: relative;
    margin-top: 3px !important;
    vertical-align: middle;
    accent-color: #d4af37;
    box-shadow: none;
    transition: border-color 0.2s, background-color 0.2s;
}
input[type="radio"]:checked,
input[type="checkbox"]:checked {
    background-color: rgba(20, 20, 30, 0.7);
    border-color: rgba(212, 175, 55, 0.7);
}
input[type="radio"]:checked::before,
input[type="checkbox"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #d4af37; /* Gold color for selected */
}
input[type="radio"]:hover,
input[type="checkbox"]:hover {
    border-color: rgba(212, 175, 55, 0.7);
}

/* Decorative elements */
h2::before, h2::after {
    content: "❧";
    display: inline-block;
    margin: 0 10px;
    color: #d4af37; /* Gold color for decorative elements */
    font-size: 0.8em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Improve the chapter select dropdown */
#chapter-select {
    background-color: rgba(20, 20, 30, 0.7);
    border: 1px solid rgba(155, 139, 111, 0.3);
    padding: 10px;
    font-family: 'Garamond', 'Times New Roman', serif;
    font-size: 1.1em;
    color: #e8d9b5;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23d4af37' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

#chapter-select:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.6);
}

/* Event placeholder styling */
.event-placeholder {
    padding: 20px;
    text-align: center;
    color: #e8d9b5;
    font-style: italic;
    background-color: rgba(20, 20, 30, 0.5);
    border-radius: 5px;
    border: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Downtime Activities Styles */
#downtime-section {
    margin-top: 30px;
}

.toggle-button {
    background-color: rgba(30, 30, 45, 0.8);
    color: #e8d9b5;
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 10px 20px;
    margin-bottom: 20px;
    width: 100%;
    text-align: center;
    font-size: 1.1em;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.toggle-button:hover {
    background-color: rgba(40, 40, 60, 0.9);
    border-color: rgba(212, 175, 55, 0.6);
}

.hidden {
    display: none;
}

.faction-activities {
    background-color: rgba(20, 20, 30, 0.5);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.faction-activities h3 {
    color: #d4af37;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.activity-list {
    display: grid;
    gap: 15px;
}

.activity-card {
    background-color: rgba(25, 25, 35, 0.6);
    padding: 15px;
    border-radius: 5px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.activity-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #e8d9b5;
}

.activity-description {
    margin-bottom: 15px;
    font-style: italic;
    color: #e8d9b5;
}

.activity-outcome {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.outcome-button {
    flex: 1;
    padding: 8px;
    text-align: center;
    background-color: rgba(30, 30, 45, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.outcome-button:hover {
    background-color: rgba(40, 40, 60, 0.9);
    border-color: rgba(212, 175, 55, 0.6);
}

.outcome-button.success {
    border-color: rgba(127, 191, 127, 0.4);
}

.outcome-button.major-success {
    border-color: rgba(212, 175, 55, 0.6);
}

.outcome-button.failure {
    border-color: rgba(255, 102, 102, 0.4);
}

/* Activity Feedback Styles */
.feedback-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.activity-feedback {
    background-color: rgba(20, 20, 30, 0.9);
    padding: 15px;
    border-radius: 5px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
    color: #e8d9b5;
    min-width: 250px;
}

.activity-feedback p {
    margin-bottom: 10px;
}

.activity-feedback ul {
    list-style-type: none;
    padding-left: 10px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Faction Selection Dialog Styles */
.faction-selection-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.dialog-content {
    background-color: rgba(20, 20, 30, 0.95);
    padding: 20px;
    border-radius: 5px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
    color: #e8d9b5;
    min-width: 300px;
    text-align: center;
}

.dialog-content p {
    margin-bottom: 20px;
    font-size: 1.1em;
}

.faction-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faction-buttons button {
    padding: 10px;
    background-color: rgba(30, 30, 45, 0.8);
    color: #e8d9b5;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.faction-buttons button:hover {
    background-color: rgba(40, 40, 60, 0.9);
    border-color: rgba(212, 175, 55, 0.6);
    transform: translateY(-1px);
}

.mission-selection {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.faction-select,
.mission-count {
    padding: 5px;
    border: 1px solid #666;
    border-radius: 4px;
    background-color: #2a2a2a;
    color: #fff;
    font-size: 14px;
}

.faction-select:focus,
.mission-count:focus {
    outline: none;
    border-color: #4a4a4a;
}

/* Stronger fix for multiple-choice (checkbox) events */
.event-card.multiple .event-choices {
    display: block !important;
    flex-direction: unset !important;
    align-items: unset !important;
}
.event-card.multiple .choice-container {
    display: block !important;
    flex-direction: unset !important;
    align-items: unset !important;
    width: auto !important;
    margin-bottom: 18px;
    padding-left: 0;
}
.event-card.multiple .choice-container input[type="checkbox"] {
    margin-right: 10px;
    margin-left: 0;
    vertical-align: middle;
}
.event-card.multiple .choice-text {
    display: inline-block;
    vertical-align: middle;
    text-align: left;
    margin-left: 2px;
}

/* Faction Relationships Styles */
.faction-relationships {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(15, 15, 25, 0.6);
    border-radius: 5px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.relationship {
    margin-bottom: 15px;
}

.relationship:last-child {
    margin-bottom: 0;
}

.relationship h4 {
    color: #d4af37;
    margin-bottom: 5px;
    font-weight: normal;
    letter-spacing: 1px;
}

.relationship p {
    font-size: 1.1em;
    color: #e8d9b5;
    margin: 0;
    padding: 5px 0;
}

/* Faction Wares Styles */
#faction-wares-section {
    margin-top: 30px;
    padding: 20px;
    background-color: rgba(15, 15, 25, 0.7);
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
    border: none;
}

.wares-guidelines {
    margin-bottom: 20px;
    padding: 15px;
    background-color: rgba(15, 15, 25, 0.6);
    border-radius: 5px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.wares-guidelines p:first-child {
    color: #d4af37;
    font-weight: bold;
    margin-bottom: 10px;
}

.wares-guidelines p:last-child {
    font-style: italic;
    line-height: 1.6;
}

.wares-selector {
    margin-bottom: 20px;
}

.wares-selector select {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    background-color: rgba(20, 20, 30, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #e8d9b5;
    font-size: 1.1em;
}

.wares-display {
    background-color: rgba(15, 15, 25, 0.6);
    border-radius: 5px;
    padding: 20px;
}

.ware-item {
    margin-bottom: 15px;
    padding: 15px;
    background-color: rgba(20, 20, 30, 0.5);
    border-radius: 5px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.ware-item:last-child {
    margin-bottom: 0;
}

.ware-fp {
    color: #d4af37;
    font-weight: bold;
    margin-bottom: 10px;
}

.ware-description {
    line-height: 1.6;
} 