* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* Login Screen */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: #667eea;
}

.login-container p {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.error-message {
    color: #e74c3c;
    margin-top: 1rem;
    text-align: center;
    display: none;
}

.error-message.show {
    display: block;
}

/* Main App */
.main-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.app-header {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.app-header h1 {
    color: #667eea;
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    color: #666;
}

/* Three Pane Layout */
.three-pane-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.pane {
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.forums-pane {
    width: 250px;
    min-width: 200px;
}

.threads-pane {
    width: 350px;
    min-width: 300px;
}

.posts-pane {
    flex: 1;
    border-right: none;
}

.pane-header {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}

.pane-header h2 {
    font-size: 1.1rem;
    color: #333;
}

.pane-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Forums List */
.forum-item {
    padding: 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.forum-item:hover {
    background-color: #f8f8f8;
}

.forum-item.active {
    background-color: #e8eef7;
    border-left: 3px solid #667eea;
}

.forum-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}

.forum-content {
    flex: 1;
    min-width: 0;
}

.forum-item h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: #333;
}

.forum-item p {
    font-size: 0.875rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-preview {
    margin-top: 0.5rem;
}

/* Threads List */
.thread-item {
    padding: 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.thread-item:hover {
    background-color: #f8f8f8;
}

.thread-item.active {
    background-color: #e8eef7;
    border-left: 3px solid #667eea;
}

.thread-item h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.thread-meta {
    font-size: 0.875rem;
    color: #666;
    display: flex;
    justify-content: space-between;
}

/* Posts Container */
.posts-container {
    padding: 1rem;
}

.post {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #fafafa;
    border-radius: 4px;
    border-left: 3px solid #667eea;
}

.post.reply {
    margin-left: 2rem;
    border-left-color: #95a5a6;
}

.post-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

.post-author {
    font-weight: 600;
    color: #667eea;
}

.post-content {
    margin: 1rem 0;
    line-height: 1.6;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.post-content p {
    margin-bottom: 0.75rem;
}

.post-content code {
    background: #f0f0f0;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.post-content pre {
    background: #f0f0f0;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content ul,
.post-content ol {
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.post-content a {
    color: #667eea;
    text-decoration: none;
}

.post-content a:hover {
    text-decoration: underline;
}

.post-media {
    margin-top: 1rem;
}

.post-media img,
.post-media video {
    max-width: 100%;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.post-actions {
    margin-top: 0.5rem;
}

.reply-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

.reply-btn:hover {
    text-decoration: underline;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 2rem;
    font-style: italic;
}

/* Post Composer */
.post-composer {
    border-top: 1px solid #e0e0e0;
    padding: 1rem;
    background: #fafafa;
}

.composer-header h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #333;
}

#post-content {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

.composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
}

.media-preview {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.media-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 4px;
    overflow: hidden;
}

.media-preview-item img,
.media-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-preview-item .remove-media {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.75rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Modal */
.modal {
    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: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
