:root {
    /* @tweakable base background color */
    --base-background: #2a3238;
    
    /* @tweakable increased blue background color */
    --blue-background: #2a3242;
    
    /* Use background color from the active mode */
    --background-color: var(--base-background);
    
    /* @tweakable card and section background color */
    --card-background: #353f47;
    
    /* @tweakable text color for main content */
    --text-color: #e1e5e8;
    
    /* @tweakable secondary text color */
    --text-color-secondary: #b0b8bd;
    
    /* @tweakable border color for elements */
    --border-color: #464d54;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.subtitle {
    color: var(--text-color-secondary);
    font-size: 1.1rem;
}

.upload-section {
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
}

.upload-area {
    flex: 1;
}

.drop-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    background-color: var(--card-background);
    transition: all 0.3s;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    position: relative;
}

.drop-area:hover {
    border-color: var(--text-color-secondary);
    background-color: #3a444c;
}

.upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#uploadIcon {
    width: 64px;
    height: 64px;
    opacity: 0.6;
}

.preview-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#imagePreview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.remove-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #ff4444;
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
}

.submit-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #45a049;
}

.submit-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.result-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tier-card {
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    overflow: hidden;
}

.tier-badge {
    width: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
}

.tier-content {
    padding: 1.5rem;
    flex-grow: 1;
}

.tier-content h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.tier-content p {
    font-size: 1rem;
    line-height: 1.6;
}

/* Tier Management */
.tier-management {
    margin-top: 2rem;
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tier-management h2 {
    margin-bottom: 1rem;
    text-align: center;
}

.tier-list {
    list-style: none;
    margin-bottom: 1rem;
}

.tier-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    cursor: grab;
    background-color: #3a444c;
    position: relative;
}

.tier-item:active {
    cursor: grabbing;
}

.tier-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-right: 0.75rem;
}

.tier-name {
    flex-grow: 1;
    font-weight: bold;
}

.edit-tier {
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    font-size: 1.2rem;
}

.tier-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.control-btn {
    flex: 1;
    min-width: 120px;
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.control-btn:not(.secondary) {
    background-color: #4285F4;
    color: white;
}

.control-btn:not(.secondary):hover {
    background-color: #357ae8;
}

.control-btn.secondary {
    background-color: #3a444c;
    color: var(--text-color);
}

.control-btn.secondary:hover {
    background-color: #454d54;
}

/* Drag and Drop Styling */
.tier-item.dragging {
    opacity: 0.5;
}

.tier-item.drag-over {
    border-top: 2px solid #4285F4;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--card-background);
    margin: 15% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color-secondary);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #3a444c;
    color: var(--text-color);
}

.delete-btn {
    background-color: #ff4444;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    margin-top: 0.5rem;
}

.delete-btn:hover {
    background-color: #dd3333;
}

/* Reorder handles */
.drag-handle {
    cursor: grab;
    margin-right: 10px;
    color: #aaa;
    font-size: 1.2rem;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Add styles for the tier list display */
.tier-list-display {
    margin-top: 2rem;
    margin-bottom: 1rem;
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tier-list-display h2 {
    margin-bottom: 1rem;
    text-align: center;
}

.tier-row {
    display: flex;
    margin-bottom: 1rem;
    min-height: 80px;
}

.tier-label {
    width: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    margin-right: 1rem;
}

.tier-images {
    flex-grow: 1;
    background-color: #3a444c;
    border-radius: 4px;
    padding: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.tier-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid white;
}

/* Add styles for topic selector */
.topic-section {
    margin-bottom: 2rem;
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
}

.topic-selector {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.topic-selector label {
    font-size: 1.1rem;
    font-weight: bold;
}

.topic-input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.topic-input {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #3a444c;
    color: var(--text-color);
    font-size: 1rem;
    width: 100%;
}

.preset-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.preset-topic {
    background-color: #3a444c;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.preset-topic:hover {
    background-color: #454d54;
}

.preset-topic.active {
    background-color: #4285F4;
    border-color: #4285F4;
    color: white;
}

/* Add new styles */
.settings-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.settings-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.settings-content {
    width: 300px;
}

.settings-group {
    margin-top: 1.5rem;
}

.toggle-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.toggle-label input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background-color: #3a444c;
    border-radius: 12px;
    transition: 0.3s;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: 0.3s;
}

input:checked + .toggle-slider {
    background-color: #4285F4;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}