* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #2c3e50;
    font-size: 2em;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #7f8c8d;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #bdc3c7 !important;
    color: #7f8c8d !important;
}

.btn-primary:not(:disabled) {
    background-color: #3498db !important;
    color: white !important;
    opacity: 1 !important;
}

.main-content {
    display: flex;
    gap: 20px;
    height: calc(100vh - 180px);
}

.left-panel {
    width: 300px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.left-panel h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5em;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.topics-list {
    list-style: none;
}

.topic-item {
    padding: 15px;
    margin-bottom: 10px;
    background-color: #ecf0f1;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.topic-item:hover {
    background-color: #d5dbdb;
    border-left-color: #3498db;
    transform: translateX(5px);
}

.topic-item.active {
    background-color: #3498db;
    color: white;
    border-left-color: #2980b9;
}

.topic-item h3 {
    font-size: 1.1em;
    margin-bottom: 5px;
}

.topic-item p {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-top: 5px;
}

.topic-item.active p {
    color: rgba(255,255,255,0.9);
}

.topic-item .topic-date {
    font-size: 0.8em;
    margin-top: 8px;
}

.right-panel {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.welcome-message {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.welcome-message h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.posts-header h2 {
    color: #2c3e50;
    font-size: 1.5em;
    margin: 0;
    flex: 1;
}

.posts-header .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.posts-list {
    list-style: none;
}

.post-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border-left: 3px solid #3498db;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.post-item:hover {
    background-color: #e9ecef;
    transform: translateX(3px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.post-item .post-filename {
    color: #3498db;
    font-weight: 600;
    font-size: 0.9em;
    min-width: 200px;
    font-family: 'Courier New', monospace;
}

.post-item .post-preview {
    color: #7f8c8d;
    font-size: 0.95em;
    flex: 1;
}

.loading {
    text-align: center;
    color: #7f8c8d;
    padding: 20px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
}

.modal-large {
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 20px;
}

.close:hover {
    color: #000;
}

.modal-content h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #2c3e50;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.message {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.post-content-display {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.8;
    font-size: 1.05em;
    color: #333;
    padding: 10px 0;
}

