/* Active nav link */
.nav-links a.active {
    color: var(--primary-blue);
    font-weight: 600;
}

/* Forum header row with action button */
.forum-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.forum-header-main {
    max-width: 70%;
}

.new-discussion-btn {
    white-space: nowrap;
}

/* New discussion modal */
.new-discussion-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

.new-discussion-modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 640px;
    padding: 1.75rem 2rem;
    max-height: 90vh;
    overflow-y: auto;
}

.new-discussion-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 768px) {
    .forum-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .forum-header-main {
        max-width: 100%;
    }

    .new-discussion-modal {
        margin: 0 1rem;
        padding: 1.25rem 1.5rem;
    }
}

.discussion-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
    margin-bottom: 6px;
}

.discussion-card:hover {
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary-blue);
    transform: translateX(5px);
}

.discussion-header {
    margin-bottom: 1rem;
    cursor: pointer;
}

.discussion-title {
    font-size: 1.3rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.discussion-meta {
    color: #6b7280;
    font-size: 0.9rem;
}

.discussion-preview {
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 1rem;
    cursor: pointer;
}

.discussion-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.reply-count {
    color: #6b7280;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.reply-count:hover {
    color: var(--primary-blue);
    text-decoration: underline;
}

/* Inline Reply Section */
.inline-replies {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: var(--radius-md);
    border-top: 2px solid var(--primary-blue);
}

.replies-content h4 {
    color: var(--text-main);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.replies-list {
    margin-bottom: 1.5rem;
}

.reply-card {
    background: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--primary-blue);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.reply-header strong {
    color: var(--text-main);
    font-size: 0.95rem;
}

.reply-date {
    color: #6b7280;
    font-size: 0.85rem;
}

.reply-content {
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
}

.no-replies {
    text-align: center;
    color: #6b7280;
    padding: 1.5rem;
    font-style: italic;
}

.reply-form-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.reply-form-section h4 {
    margin-bottom: 1rem;
    color: var(--text-main);
}

.inline-reply-form .form-group {
    margin-bottom: 1rem;
}

.inline-reply-form label {
    display: block;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.inline-reply-form input[type="text"],
.inline-reply-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.inline-reply-form input[type="text"]:focus,
.inline-reply-form textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 1px rgba(15, 98, 254, 0.2);
}

.inline-reply-form textarea {
    resize: vertical;
    min-height: 100px;
}

.inline-reply-form .btn-primary {
    margin-top: 0.5rem;
}

/* Like Button Styles */
.like-btn {
    background: none;
    border: 2px solid #e0e0e0;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.like-btn:hover {
    border-color: #ff4757;
    background: #fff5f7;
}

.like-btn.liked {
    background: #ff4757;
    border-color: #ff4757;
    color: white;
}

/* Delete Button Styles */
.delete-btn {
    background: none;
    border: 2px solid #e0e0e0;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: auto;
}

.delete-btn:hover {
    border-color: #dc3545;
    background: #fff5f5;
    color: #dc3545;
}

/* File Upload Styles */
.file-hint {
    display: block;
    color: #666;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

input[type="file"] {
    padding: 0.5rem;
    border: 2px dashed #ccc;
    border-radius: var(--radius-md);
    width: 100%;
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: var(--primary-blue);
}

/* Attachments Preview in Cards */
.attachments-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.attachment-thumbnail {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0;
    position: relative;
}

.download-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 1.2rem;
}

.attachment-thumbnail:hover .download-btn {
    opacity: 1;
}

.download-btn:hover {
    background: white;
    transform: scale(1.1);
}

.attachment-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue);
}

.attachment-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.attachment-badge {
    background: #f0f0f0;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    color: #555;
    text-decoration: none;
    transition: background 0.2s;
}

.attachment-badge:hover {
    background: #e0e0e0;
    text-decoration: underline;
}

.more-attachments {
    background: var(--primary-blue);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
}

/* Custom Confirmation Modal */
.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirm-modal-overlay.show {
    opacity: 1;
}

.confirm-modal {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.confirm-modal-overlay.show .confirm-modal {
    transform: scale(1);
}

.confirm-modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.confirm-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #1f2937;
    font-weight: 600;
}

.confirm-modal-body {
    padding: 1.5rem;
}

.confirm-modal-body p {
    margin: 0;
    color: #6b7280;
    line-height: 1.6;
}

.confirm-modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.confirm-btn-cancel,
.confirm-btn-confirm {
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.confirm-btn-cancel {
    background: #f3f4f6;
    color: #374151;
}

.confirm-btn-cancel:hover {
    background: #e5e7eb;
}

.confirm-btn-confirm {
    background: #dc2626;
    color: white;
}

.confirm-btn-confirm:hover {
    background: #b91c1c;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 2000;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    color: #374151;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Toast Types */
.toast-success {
    border-left: 4px solid #10b981;
}

.toast-success .toast-icon {
    background: #d1fae5;
    color: #059669;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-error .toast-icon {
    background: #fee2e2;
    color: #dc2626;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-warning .toast-icon {
    background: #fef3c7;
    color: #d97706;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-info .toast-icon {
    background: #dbeafe;
    color: #2563eb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .new-discussion-section {
        padding: 1.5rem;
    }

    .attachment-thumbnail {
        width: 100px;
        height: 100px;
    }

    .inline-replies {
        padding: 1rem;
    }

    .toast-notification {
        min-width: auto;
        max-width: calc(100% - 40px);
        right: 20px;
        left: 20px;
    }

    .confirm-modal {
        width: calc(100% - 40px);
    }
}