/* comments.css - Styling for commenting system */
/* Matches existing site theme with dark mode support */

.comments-wrapper {
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 2px solid #e5e7eb;
}

.dark .comments-wrapper {
    border-top-color: #374151;
}

/* Toggle Button */
.comments-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e3a8a;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.dark .comments-toggle {
    background: #1f2937;
    border-color: #374151;
    color: #93c5fd;
}

.comments-toggle:hover {
    border-color: #0ea5e9;
    background: #f0f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15);
}

.dark .comments-toggle:hover {
    border-color: #0ea5e9;
    background: #1e293b;
}

.comments-toggle i:first-child {
    font-size: 1.25rem;
    color: #0ea5e9;
}

.comments-toggle i:last-child {
    margin-left: auto;
    font-size: 0.875rem;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.dark .comments-toggle i:last-child {
    color: #9ca3af;
}

/* Collapsible Content */
.comments-content {
    margin-top: 1.5rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comments-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dbeafe;
}

.dark .comments-title {
    color: #93c5fd;
    border-bottom-color: #1e40af;
}

/* Comment Form */
.comment-form-container {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

.dark .comment-form-container {
    background: #1f2937;
    border-color: #374151;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    color: #1f2937;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dark .form-input,
.dark .form-textarea {
    background: #111827;
    border-color: #4b5563;
    color: #f3f4f6;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.submit-btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-message {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    margin-top: 0.5rem;
}

.form-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.dark .form-message.success {
    background: #064e3b;
    color: #6ee7b7;
    border-color: #047857;
}

.form-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.dark .form-message.error {
    background: #7f1d1d;
    color: #fca5a5;
    border-color: #b91c1c;
}

/* Comments List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.loading-state,
.no-comments {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-size: 1rem;
}

.dark .loading-state,
.dark .no-comments {
    color: #9ca3af;
}

.comment-item {
    padding: 1.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    transition: box-shadow 0.2s ease;
}

.dark .comment-item {
    background: #1f2937;
    border-color: #374151;
}

.comment-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dark .comment-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.comment-item.pinned {
    border-color: #fbbf24;
    border-width: 2px;
    background: linear-gradient(to bottom, #fffbeb, white);
}

.dark .comment-item.pinned {
    border-color: #f59e0b;
    background: linear-gradient(to bottom, #451a03, #1f2937);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.author-name {
    font-weight: 600;
    font-size: 1.0625rem;
    color: #1e3a8a;
}

.dark .author-name {
    color: #93c5fd;
}

.badge {
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-admin {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.badge-pinned {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.comment-time {
    font-size: 0.875rem;
    color: #6b7280;
}

.dark .comment-time {
    color: #9ca3af;
}

.pin-btn {
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    color: #6b7280;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.dark .pin-btn {
    color: #9ca3af;
}

.pin-btn:hover {
    color: #f59e0b;
    transform: scale(1.1);
}

.pin-btn .fa-thumbtack.pinned {
    color: #f59e0b;
}

.comment-body {
    font-size: 1rem;
    line-height: 1.6;
    color: #374151;
}

.dark .comment-body {
    color: #d1d5db;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .comments-wrapper {
        margin: 2rem 0;
        padding: 1.5rem 0;
    }
    
    .comment-form-container {
        padding: 1rem;
    }
    
    .comment-item {
        padding: 1rem;
    }
    
    .comment-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .comment-meta {
        width: 100%;
        justify-content: space-between;
    }
}