:root {
    --primary-red: #8c1c1c;
    --dark-bg: #121212;
    --medium-bg: #1e1e1e;
    --light-bg: #2a2a2a;
    --text-light: #e0e0e0;
    --text-medium: #b3b3b3;
    --border-color: #444;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-light);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 2rem;
}

.page-container {
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.main-content {
    flex: 2;
}

.sidebar {
    flex: 1;
    align-self: flex-start;
    position: sticky;
    top: 2rem;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.subtitle {
    color: var(--text-medium);
    font-size: 0.9rem;
}

h1 {
    margin: 0;
    font-weight: 300;
    letter-spacing: 2px;
}

h2 {
    color: var(--primary-red);
    margin-top: 0;
    font-size: 1.4rem;
    border-bottom: 1px solid #555;
    padding-bottom: 0.5rem;
}

h3 {
    margin-top: 0;
    color: #ccc;
    font-size: 1.1rem;
}

button {
    background-color: var(--primary-red);
    color: white;
    border: 1px solid #c52525;
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    border-radius: 4px;
}

button:hover {
    background-color: #a82222;
}

#characterSheet {
    transition: all 0.3s ease;
    min-height: 300px;
    margin-top: 1rem;
}

#characterSheet.sheet-active {
    background-color: var(--medium-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.empty-sheet-message {
    text-align: center;
    color: #666;
    margin-top: 2rem;
}

.sidebar-toggle {
    text-align: left;
    margin-bottom: 0;
    position: relative;
    background-color: var(--light-bg);
    border-color: var(--border-color);
}

.sidebar-toggle.secondary-toggle {
    background-color: #2c2c2c;
    border-color: #444;
    margin-top: 1rem;
    color: #ccc;
}

.sidebar-toggle:hover,
.sidebar-toggle.secondary-toggle:hover {
    background-color: var(--primary-red);
    border-color: #c52525;
    color: white;
}

.arrow {
    float: right;
    font-size: 13px;
}

.sidebar-toggle.active {
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background-color: var(--medium-bg);
}

.sidebar-content {
    background-color: var(--medium-bg);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.sidebar-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.full-width {
    grid-column: span 2;
}

.option-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.option-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--text-medium);
}

.option-group select {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    background-color: var(--light-bg);
    color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.option-group input {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    background-color: var(--light-bg);
    color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
}

#createButton {
    margin-top: 1rem;
}

.sidebar-spacer {
    height: 1rem;
}

#debugContent {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-red) var(--light-bg);
}

#debugContent::-webkit-scrollbar {
    width: 8px;
}

#debugContent::-webkit-scrollbar-track {
    background: var(--light-bg);
}

#debugContent::-webkit-scrollbar-thumb {
    background-color: var(--primary-red);
    border-radius: 4px;
}

#debugList {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #bbb;
}

.sheet-section {
    margin-bottom: 2rem;
}

.persona-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    font-size: 0.95rem;
}

.persona-grid p {
    margin: 0;
    border-bottom: 1px solid #333;
    padding-bottom: 4px;
}

.persona-grid strong {
    color: var(--text-medium);
}

.attributes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.items-column-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0 1.5rem;
}

.attribute-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
    height: 24px;
}

.attribute-item .label.muted {
    color: #555;
}

.dots-display {
    display: flex;
    gap: 3px;
}

.dot {
    height: 10px;
    width: 10px;
    background-color: #333;
    border: 1px solid #555;
    border-radius: 50%;
    display: inline-block;
}

.dot.filled {
    background-color: #e0e0e0;
    border-color: #fff;
    box-shadow: 0 0 2px rgba(255,255,255,0.5);
}

.dot.filled-special {
    background-color: #b91c1c;
    border-color: #ff4d4d;
    box-shadow: 0 0 4px rgba(255, 0, 0, 0.6);
}

#progressContainer {
    display: none;
    width: 100%;
    background: #333;
    margin-top: 10px;
    border-radius: 4px;
}

#progressBar {
    width: 0%;
    height: 20px;
    background: #8c1c1c;
    text-align: center;
    color: white;
    font-size: 12px;
    border-radius: 4px;
    transition: width 0.3s;
}

.github-corner {
    position: absolute;
    top: 0;
    right: 0;
    border: 0;
    z-index: 1000;
}

.github-corner-icon {
    position: absolute;
    top: 0;
    right: 0;
    border: 0;
    fill: #8c1c1c;
    color: #121212;
}

.github-corner .octo-arm {
    transform-origin: 130px 106px;
}

.github-corner:hover .octo-arm {
    animation: octocat-wave 560ms ease-in-out;
}

@keyframes octocat-wave {
    0%, 100% {
        transform: rotate(0);
    }

    20%, 60% {
        transform: rotate(-25deg);
    }

    40%, 80% {
        transform: rotate(10deg);
    }
}

@media (max-width: 500px) {
    .github-corner:hover .octo-arm {
        animation: none;
    }

    .github-corner .octo-arm {
        animation: octocat-wave 560ms ease-in-out;
    }
}

.dark-pack-container {
    margin-top: 2rem;
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 1rem;
}

.dark-pack-logo {
    max-width: 150px;
    width: 100%;
    height: auto;
    margin-bottom: 0.5rem;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.dark-pack-logo:hover {
    opacity: 1;
}

.legal-text {
    font-size: 0.7rem;
    color: #666;
    line-height: 1.3;
    text-align: center;
}

.legal-text a {
    color: #888;
    text-decoration: underline;
}

.contact-details {
    padding: 1rem 0;
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.5;
}

.contact-details p:first-child {
    margin-top: 0;
}

.contact-details a {
    color: var(--primary-red);
}

#downloadPdfButton {
    display: none;
    margin-top: 10px;
    background-color: #2c3e50 !important;
    border-color: #34495e !important;
    transition: all 0.3s ease;
}

#downloadPdfButton:hover {
    background-color: #3e5871 !important;
    border-color: #506e8a !important;
    box-shadow: 0 0 10px rgba(62, 88, 113, 0.5);
    transform: translateY(-1px);
}

#downloadPdfButton:active {
    transform: scale(0.98);
}

#downloadPdfButton:disabled {
    background-color: #555 !important;
    border-color: #666 !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
