/**
 * Team Discussions - Minimalist CSS
 * Clean, simple design for internal communication platform
 * Optimized for scalability up to 100+ users
 */

/* CSS Variables for easy theming */
:root {
    --td-primary: #2563eb;
    --td-primary-hover: #1d4ed8;
    --td-secondary: #64748b;
    --td-success: #10b981;
    --td-error: #ef4444;
    --td-bg: #f8fafc;
    --td-card-bg: #ffffff;
    --td-border: #e2e8f0;
    --td-text: #1e293b;
    --td-text-light: #64748b;
    --td-radius: 8px;
    --td-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --td-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Base Container */
.td-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--td-text);
    line-height: 1.6;
}

/* Messages (Success/Error) */
.td-message {
    padding: 12px 16px;
    border-radius: var(--td-radius);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.td-message-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.td-message-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Header */
.td-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--td-border);
}

.td-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--td-text);
}

/* Buttons */
.td-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--td-radius);
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.td-btn-primary {
    background: var(--td-primary);
    color: white;
}

.td-btn-primary:hover {
    background: var(--td-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--td-shadow-hover);
}

.td-btn-secondary {
    background: var(--td-card-bg);
    color: var(--td-secondary);
    border: 1px solid var(--td-border);
}

.td-btn-secondary:hover {
    background: var(--td-bg);
    border-color: var(--td-secondary);
}

.td-btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.td-btn-full {
    width: 100%;
}

/* Discussion List */
.td-discussion-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.td-discussion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--td-card-bg);
    border: 1px solid var(--td-border);
    border-radius: var(--td-radius);
    transition: all 0.2s ease;
}

.td-discussion-item:hover {
    border-color: var(--td-primary);
    box-shadow: var(--td-shadow-hover);
    transform: translateY(-2px);
}

.td-discussion-main {
    flex: 1;
    min-width: 0;
}

.td-discussion-title {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
}

.td-discussion-title a {
    color: var(--td-text);
    text-decoration: none;
}

.td-discussion-title a:hover {
    color: var(--td-primary);
}

.td-discussion-meta {
    font-size: 13px;
    color: var(--td-text-light);
}

.td-separator {
    margin: 0 8px;
    opacity: 0.5;
}

.td-discussion-stats {
    flex-shrink: 0;
    margin-left: 16px;
}

.td-comment-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--td-bg);
    border-radius: 20px;
    font-size: 13px;
    color: var(--td-text-light);
}

/* Empty State */
.td-empty-state {
    text-align: center;
    padding: 48px 24px;
    background: var(--td-bg);
    border-radius: var(--td-radius);
    color: var(--td-text-light);
}

/* Pagination */
.td-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--td-border);
}

.td-page-link {
    padding: 8px 16px;
    background: var(--td-card-bg);
    border: 1px solid var(--td-border);
    border-radius: var(--td-radius);
    color: var(--td-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.td-page-link:hover {
    background: var(--td-primary);
    color: white;
    border-color: var(--td-primary);
}

.td-page-info {
    font-size: 14px;
    color: var(--td-text-light);
}

/* Back Link */
.td-back-link {
    margin-bottom: 20px;
}

.td-back-link a {
    color: var(--td-primary);
    text-decoration: none;
    font-size: 14px;
}

.td-back-link a:hover {
    text-decoration: underline;
}

/* Single Discussion */
.td-single-discussion {
    background: var(--td-card-bg);
    border: 1px solid var(--td-border);
    border-radius: var(--td-radius);
    padding: 24px;
    margin-bottom: 24px;
}

.td-discussion-header h1 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 600;
}

.td-discussion-content {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--td-border);
}

.td-discussion-content p {
    margin: 0 0 16px 0;
}

/* Comments Section */
.td-comments-section {
    margin-top: 32px;
}

.td-comments-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--td-border);
}

.td-comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.td-comment {
    background: var(--td-bg);
    border-radius: var(--td-radius);
    padding: 16px;
}

.td-comment-meta {
    font-size: 13px;
    color: var(--td-text-light);
    margin-bottom: 8px;
}

.td-comment-content p {
    margin: 0;
}

.td-no-comments {
    color: var(--td-text-light);
    font-style: italic;
    text-align: center;
    padding: 24px;
    background: var(--td-bg);
    border-radius: var(--td-radius);
}

/* Reply Form */
.td-reply-form {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--td-border);
}

.td-reply-form h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
}

/* Forms */
.td-form-container {
    background: var(--td-card-bg);
    border: 1px solid var(--td-border);
    border-radius: var(--td-radius);
    padding: 32px;
}

.td-form-container h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
}

.td-form-description {
    color: var(--td-text-light);
    margin-bottom: 24px;
    font-size: 14px;
}

.td-auth-form {
    max-width: 400px;
    margin: 40px auto;
}

.td-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.td-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.td-form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--td-text);
}

.td-form-group input,
.td-form-group textarea,
.td-reply-form textarea {
    padding: 12px 14px;
    border: 1px solid var(--td-border);
    border-radius: var(--td-radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.td-form-group input:focus,
.td-form-group textarea:focus,
.td-reply-form textarea:focus {
    outline: none;
    border-color: var(--td-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.td-form-group textarea,
.td-reply-form textarea {
    resize: vertical;
    min-height: 120px;
}

.td-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.td-form-footer {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--td-border);
}

.td-form-footer a {
    color: var(--td-primary);
    text-decoration: none;
    font-size: 14px;
}

.td-form-footer a:hover {
    text-decoration: underline;
}

/* User Widget */
.td-user-widget {
    display: flex;
    align-items: center;
    gap: 12px;
}

.td-user-name {
    font-size: 14px;
    color: var(--td-text);
}

/* Login Notice */
.td-login-notice {
    text-align: center;
    padding: 48px 24px;
    background: var(--td-bg);
    border-radius: var(--td-radius);
    color: var(--td-text-light);
}

.td-login-notice a {
    color: var(--td-primary);
    text-decoration: none;
    font-weight: 500;
}

.td-login-notice a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 640px) {
    .td-container {
        padding: 16px;
    }
    
    .td-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
        text-align: center;
    }
    
    .td-discussion-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .td-discussion-stats {
        margin-left: 0;
    }
    
    .td-form-container {
        padding: 20px;
    }
    
    .td-form-actions {
        flex-direction: column;
    }
    
    .td-btn {
        width: 100%;
    }
    
    .td-pagination {
        flex-wrap: wrap;
    }
}
