:root {
    --primary-color: #8e459d;
    --secondary-color: #006aff7c;
    --bg-color: #0f0f0f;
    --section-bg: #092d4277;
    --text-color: #ffffff;
    --accent-color: #8e459d;
}

body {
    font-family: monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
}

.character-header-image {
    max-width: 100%;
    max-height: 120px;
    display: block;
    margin: 0 auto;
  }
  
  header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-image: url('https://png.pngtree.com/background/20230202/original/pngtree-blue-flowing-holographic-neon-colors-background-picture-image_2025494.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

h1 {
    margin: 0;
    font-size: 2.5rem;
}

.description {
    font-style: italic;
    margin-top: 10px;
}

.controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #1281c1;
}

.btn-secondary {
    background-color: var(--accent-color);
}

.btn-secondary:hover {
    background-color: #2a6f97;
}

.sections-container {
    margin-top: 20px;
}

.section {
    background-image: url('assets/bg2.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.section-title {
    font-size: 1.5rem;
    margin: 0;
    font-weight: bold;
    flex-grow: 1;
}

.section-title-input {
    font-size: 1.5rem;
    font-weight: bold;
    flex-grow: 1;
    border: 1px solid #ccc;
    padding: 5px;
    border-radius: 4px;
}

.section-actions {
    display: flex;
    gap: 10px;
}

.combos-list {
    list-style-type: none;
    padding: 0;
}

.combo-item {
    background-color: #353535;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}

.combo-text {
    flex-grow: 1;
    margin-right: 10px;
    font-family: monospace;
    font-size: 1.2rem;
    align-self: center;
}

.combo-rendered {
    flex-basis: 100%;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ccc;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.combo-input {
    flex-grow: 1;
    margin-right: 10px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    font-size: 1.2rem;
}

.combo-actions {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.9rem;
}

.btn-delete {
    background-color: #ec0316;
}

.btn-delete:hover {
    background-color: #a00404;
}

.btn-edit {
    background-color: var(--primary-color);
}

.btn-edit:hover {
    background-color: #5c2c66;
}

.add-combo-form {
    display: flex;
    margin-top: 15px;
    gap: 10px;
    flex-wrap: wrap;
}

.new-combo-input {
    flex-grow: 1;
    padding: 10px;
    color: white;
    background-color: #0c0c0c;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    font-family: monospace;
    font-size: 1.2rem;
}

.character-select {
    color: white;
    font-family: monospace;
    padding: 10px;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    background-color: rgb(56, 56, 56);
    font-weight: bold;
}

.character-display {
    font-family: monospace;
    font-weight: bolder;
    margin-bottom: 10px;
    color: white;
    font-size: 1.4rem;
}

.footer {
    text-align: center;
    margin-top: 40px;
    color: #6c757d;
    font-size: 0.9rem;
}

.empty-message {
    text-align: center;
    color: #6c757d;
    padding: 20px;
}

/* SVG Move Icons */
.move-icon {
    display: inline-block;
    width: 50px;
    height: 50px;
    vertical-align: middle;
}

.move-text {
    display: inline-block;
    padding: 2px 5px;
    margin: 0 2px;
    background-color: #0c0c0c;
    border-radius: 3px;
    font-weight: bold;
    font-size: 18px;
}

.move-separator {
    display: inline-block;
    font-weight: bold;
    color: #666;
}

/* Text Section Styles */
.text-section {
    background-color: hsla(0, 0%, 12%, 0.95);
    border-radius: 5px;
    padding: 15px;
    margin-top: 15px;
}

.text-content {
    color: var(--text-color);
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.text-content h1,
.text-content h2,
.text-content h3,
.text-content h4,
.text-content h5,
.text-content h6 {
    color: var(--primary-color);
    margin-bottom: 0.5em;
}

.text-content h1 { font-size: 2em; }
.text-content h2 { font-size: 1.75em; }
.text-content h3 { font-size: 1.5em; }
.text-content h4 { font-size: 1.25em; }
.text-content h5 { font-size: 1.1em; }
.text-content h6 { font-size: 1em; }

.text-content p {
    margin-bottom: 1em;
}

.text-content ul,
.text-content ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

.text-content li {
    margin-bottom: 0.5em;
}

.text-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1em;
    margin: 1em 0;
    font-style: italic;
    color: #ccc;
}

.text-content code {
    background-color: #2a2a2a;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

.text-content pre {
    background-color: #2a2a2a;
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1em 0;
}

.text-content pre code {
    background-color: transparent;
    padding: 0;
}

.text-content strong {
    color: var(--accent-color);
    font-weight: bold;
}

.text-content em {
    color: #ddd;
    font-style: italic;
}

.text-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.text-content a:hover {
    color: #a066ad;
}

.text-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

.text-content th,
.text-content td {
    border: 1px solid #555;
    padding: 8px;
    text-align: left;
}

.text-content th {
    background-color: var(--primary-color);
    color: white;
}

.text-content tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
}

.text-editor {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    background-color: #1a1a1a;
    color: var(--text-color);
    border: 1px solid var(--accent-color);
    border-radius: 5px;
    font-family: monospace;
    font-size: 17px;
    line-height: 1.5;
    resize: vertical;
}

.text-editor:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(142, 69, 157, 0.3);
}

.text-editor-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.section-type-indicator {
    font-size: 0.8em;
    color: #888;
    font-style: italic;
    margin-right: 10px;
}

/* Modal Styles */
.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.5);
}

.modal-content {
    background-color: rgb(8, 8, 8);
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover {
    color: #000;
}

.svg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.svg-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border: 1px dotted #333333;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.svg-item:hover {
    background-color: var(--accent-color);
}

.svg-item.selected {
    background-color: #deeeff;
    border-color: #0066cc;
}

.svg-item img {
    width: 40px;
    height: 40px;
    margin-bottom: 5px;
}

.svg-item-label {
    font-size: 0.8rem;
    text-align: center;
}

.move-category {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.move-category-btn {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background-color: #f8f9fa;
    cursor: pointer;
    border-radius: 4px;
}

.move-category-btn.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.insert-svg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-left: 5px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
}

.insert-svg-btn:hover {
    background-color: #2a6f97;
}

.modal-footer {
    margin-top: 20px;
    text-align: right;
}

/* Media Queries */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .section-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .add-combo-form {
        flex-direction: column;
    }
    
    .combo-item {
        flex-direction: column;
    }
    
    .combo-actions {
        width: 100%;
        margin-top: 10px;
        justify-content: flex-end;
    }
    
    .svg-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
  }
  
  .loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
  }
  
  .loading-text {
    color: var(--text-color);
    font-size: 1.2rem;
    font-family: monospace;
    font-weight: bold;
  }
  
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
  
  /* Hide the main content until loading is complete */
  .container {
    opacity: 0;
    transition: opacity 0.5s ease-in;
  }
  
  .container.loaded {
    opacity: 1;
  }