/* Simulator styles - self-contained */

:root {
    --primary-color: #6363f9;
    --bg-color: white;
    --border-color: black;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Times New Roman', Times, serif;
    background: var(--bg-color);
    color: #1f2937;
}

/* Layout */
.layout {
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.sidebar {
    position: sticky;
    top: 1rem;
    width: 200px;
    height: fit-content;
}

.nav-menu {
    background: white;
    padding: 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: #1f2937;
    text-decoration: none;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.nav-item.active {
    background-color: #eff6ff;
    color: var(--primary-color);
}

.main-content {
    flex-grow: 1;
    max-width: 800px;
}

.content-section {
    display: block;
}

/* Simulator Controls */
.simulator-controls {
    background: white;
    padding: 1.5rem;
    border: 0.25px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.simulator-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.simulator-description {
    /* font-family: 'Times New Roman', Times, serif; */
    /* color: #1f2937; */
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.control-group {
    margin-bottom: 2rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.topic-controls {
    display: flex;
    gap: 0.5rem;
}

#topic-select {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 1rem;
}

.control-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s;
}

.control-btn:hover {
    transform: translateY(-1px);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#load-topic-btn {
    background-color: var(--primary-color);
    color: white;
}

.add-post-button {
    position: fixed;
    bottom: 1.5rem;
    background-color: var(--primary-color);
    color: white;
    width: 3.0rem;
    height: 3.0rem;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    /* This calculation positions it relative to main-content's right edge */
    left: calc(50% + 400px - 2.5rem);
    /* 400px is half of main-content max-width */
    transition: transform 0.2s;
}

#buttons-group {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    /*border: 0.25px solid rgba(0, 0, 0, 0.1);*/
    display: flex;
    gap: 1rem;
}

.action-btn {
    width: 6rem;
    padding: 0.5rem 0;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.action-btn:hover {
    transform: translateY(-1px);
}

.simulate-btn {
    background-color: var(--primary-color);
    color: white;
}

.reset-btn {
    background-color: #6b7280;
    color: white;
}

.toggle-btn {
    background-color: #ef4444;
    color: white;
    width: 9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.post-count {
    margin-left: 1rem;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Results Summary */
.results-summary {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.5rem;
    background: #f9fafb;
    border: 0.25px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.summary-item.passed {
    color: #10b981;
}

.summary-item.filtered {
    color: #ef4444;
}

.summary-item i {
    font-size: 1.25rem;
}

/* Section Headers */
.section-header {
    padding: 1rem 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filtered-header {
    /*background: rgba(239, 68, 68, 0.1);
    color: #ef4444;*/
    border: 0.25px solid rgba(239, 68, 68, 0.2);
}

/* Simulator Post */
.simulator-post {
    background: white;
    padding: 1.5rem;
    border: 0.25px solid rgba(0, 0, 0, 0.1);
    position: relative;
}

.simulator-post .post-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    position: relative;
}

.simulator-post .post-options {
    position: absolute;
    right: 0;
    top: 0;
}

.simulator-post .options-button {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 0.1rem;
}

.simulator-post .options-button:hover {
    color: var(--primary-color);
}

.simulator-post .options-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    padding: 0.5rem 0;
    min-width: 115px;
    display: none;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.simulator-post .options-menu.active {
    display: block;
}

.simulator-post .option-item {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.simulator-post .option-item:hover {
    background-color: #f3f4f6;
}

.simulator-post .option-item.delete-post {
    color: #ef4444;
}

.simulator-post .post-text {
    line-height: 1.5;
    font-size: 1.125rem;
    white-space: pre-wrap;
}

.simulator-post.filtered-out {
    opacity: 0.7;
    background: #fef2f2;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    width: 600px;
    height: 650px;
    display: flex;
    flex-direction: column;
}

.modal-input {
    width: 100%;
    height: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
    overflow-y: auto;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: auto;
}

.modal-button {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.submit-button {
    background-color: var(--primary-color);
    color: white;
}

.cancel-button {
    background-color: #e5e7eb;
    color: #1f2937;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-spinner {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-spinner i {
    font-size: 2rem;
    color: var(--primary-color);
}

/* Message Box */
.message-box {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.message-box-content {
    background-color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    width: 400px;
    height: 200px;
    display: flex;
    flex-direction: column;
}

.message-box-text {
    width: 100%;
    height: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-box-close {
    align-self: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    font-weight: 500;
    background-color: var(--primary-color);
    color: white;
    font-family: inherit;
}

.message-box-close:hover {
    opacity: 0.9;
}

.message-box-close::before {
    content: 'Close';
}

.message-box-close i {
    display: none;
}

/* Mode indicators - hide opposite control group */
.mode-topic-active #create-posts-group {
    display: none;
}

.mode-create-active #topic-selector-group {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        position: static;
        width: 100%;
    }

    .nav-menu {
        display: flex;
        gap: 1rem;
        overflow-x: auto;
        padding: 0.5rem;
    }

    .nav-item {
        white-space: nowrap;
    }
}
