/**
 * Comments System Styling
 * Modern and clean design that integrates with the existing site design
 */

/* Comments Section */
.comments-section {
    max-width: 800px;
    margin: 60px auto 40px;
    padding: 0 20px;
}

/* Article Reactions (Above Comments) */
.article-reactions-container {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 40px;
}

.article-reactions-header {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.article-reactions-header h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}

.article-reactions-header p {
    margin: 0;
    color: #7f8c8d;
    font-size: 15px;
}

.article-reactions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.article-reaction-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: white;
    border: 2px solid #e0e0e0;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 90px;
    color: #555;
}

.article-reaction-btn:hover {
    border-color: #3498db;
    background: #f8f9fa;
    transform: translateY(-2px);
}

.article-reaction-btn.active {
    background: #ebf5fb;
    border-color: #3498db;
    color: #2c3e50;
}

.article-reaction-icon {
    font-size: 28px;
}

.article-reaction-label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
}

.article-reaction-count {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.article-reaction-btn.active .article-reaction-count {
    color: #3498db;
}

.article-reaction-btn.active .article-reaction-label {
    color: #3498db;
}

.article-reactions-login-prompt {
    text-align: center;
    padding: 20px;
    background: white;
    border: 2px dashed #ddd;
    border-radius: 8px;
}

.article-reactions-login-prompt p {
    color: #555;
    margin: 0 0 15px 0;
    font-size: 15px;
}

.article-reactions-login-prompt .auth-buttons {
    justify-content: center;
}

.comments-header {
    border-bottom: 3px solid #2c3e50;
    padding-bottom: 15px;
    margin-bottom: 30px;
}

.comments-header h2 {
    font-size: 28px;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.comments-count {
    font-size: 16px;
    color: #7f8c8d;
}

.comments-info {
    background: #ecf0f1;
    border-left: 4px solid #3498db;
    padding: 15px 20px;
    margin-bottom: 30px;
    border-radius: 4px;
}

.comments-info p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

.comments-info a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.comments-info a:hover {
    text-decoration: underline;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.auth-buttons button {
    padding: 10px 24px;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login {
    background: #3498db;
    color: white;
}

.btn-login:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-register {
    background: #27ae60;
    color: white;
}

.btn-register:hover {
    background: #229954;
    transform: translateY(-2px);
}

/* Comment Form */
.comment-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.comment-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.user-greeting {
    font-size: 16px;
    color: #2c3e50;
    font-weight: 600;
}

.btn-logout {
    background: none;
    border: 1px solid #95a5a6;
    color: #555;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.comment-textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.comment-textarea:focus {
    outline: none;
    border-color: #3498db;
}

.comment-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.character-count {
    font-size: 15px;
    color: #7f8c8d;
}

.btn-submit-comment {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit-comment:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-submit-comment:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

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

.comment-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s ease;
}

.comment-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.author-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}

.comment-date {
    font-size: 13px;
    color: #95a5a6;
}

.btn-delete-comment {
    background: none;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete-comment:hover {
    background: #e74c3c;
    color: white;
}

.comment-content {
    color: #333;
    line-height: 1.7;
    font-size: 15px;
    margin-bottom: 15px;
    word-wrap: break-word;
}

/* Comment Votes (Upvote/Downvote) */
.comment-votes {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vote-btn:hover {
    transform: scale(1.05);
}

.vote-btn.upvote {
    color: #27ae60;
}

.vote-btn.upvote:hover {
    background: #d5f4e6;
    border-color: #27ae60;
}

.vote-btn.upvote.active {
    background: #27ae60;
    border-color: #27ae60;
    color: white;
}

.vote-btn.downvote {
    color: #e74c3c;
}

.vote-btn.downvote:hover {
    background: #fadbd8;
    border-color: #e74c3c;
}

.vote-btn.downvote.active {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

.vote-icon {
    font-size: 16px;
}

.vote-count {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* No Comments */
.no-comments {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #7f8c8d;
}

.no-comments-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.no-comments p {
    font-size: 18px;
    margin: 0;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 16px;
}

.loading-spinner::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-left: 10px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modals */
.auth-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: slideDown 0.4s ease;
}

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

.auth-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.close-modal {
    color: white;
    font-size: 32px;
    font-weight: normal;
    cursor: pointer;
    background: none;
    border: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.close-modal:hover {
    opacity: 1;
}

.auth-modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 15px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.form-error {
    color: #e74c3c;
    font-size: 15px;
    margin-top: 10px;
    display: none;
}

.form-success {
    color: #27ae60;
    font-size: 15px;
    margin-top: 10px;
    display: none;
}

.btn-primary {
    width: 100%;
    background: #3498db;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-primary:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.auth-modal-footer {
    text-align: center;
    padding: 0 30px 30px;
}

.auth-modal-footer p {
    margin: 0;
    color: #666;
    font-size: 15px;
}

.auth-modal-footer a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.auth-modal-footer a:hover {
    text-decoration: underline;
}

/* User Profile Page */
.user-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
    font-weight: bold;
}

.user-info h1 {
    margin: 0 0 5px 0;
    font-size: 28px;
    color: #2c3e50;
}

.user-info p {
    margin: 0;
    color: #7f8c8d;
    font-size: 16px;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.my-comments-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.my-comments-section h2 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 3px solid #2c3e50;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.section-description {
    color: #666;
    margin-bottom: 30px;
}

.user-comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.user-comment-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s ease;
}

.user-comment-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.comment-article-info {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.comment-article-info h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
}

.comment-article-info h3 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.comment-article-info h3 a:hover {
    color: #3498db;
}

.comment-content-preview {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.comment-actions {
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 15px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-sm:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.no-comments-message,
.error-message {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 16px;
}

.error-message {
    color: #e74c3c;
}

/* Responsive Design */
@media (max-width: 768px) {
    .comments-section {
        padding: 0 15px;
    }

    .article-reactions-container {
        padding: 20px;
    }

    .article-reactions {
        gap: 8px;
    }

    .article-reaction-btn {
        min-width: 80px;
        padding: 10px 14px;
    }

    .article-reaction-icon {
        font-size: 24px;
    }

    .article-reaction-label {
        font-size: 11px;
    }

    .article-reaction-count {
        font-size: 16px;
    }

    .comment-form {
        padding: 20px;
    }

    .comment-votes {
        gap: 6px;
    }

    .vote-btn {
        padding: 5px 10px;
        font-size: 13px;
    }

    .auth-modal-content {
        margin: 10% auto;
        width: 95%;
    }

    .auth-modal-header,
    .auth-modal-body,
    .auth-modal-footer {
        padding: 20px;
    }

    .user-profile-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .comment-form-footer {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .btn-submit-comment {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .comments-header h2 {
        font-size: 22px;
    }

    .article-reactions-container {
        padding: 15px;
    }

    .article-reaction-btn {
        min-width: 70px;
        padding: 8px 10px;
    }

    .article-reaction-icon {
        font-size: 22px;
    }

    .article-reaction-label {
        font-size: 10px;
    }

    .article-reaction-count {
        font-size: 15px;
    }

    .comment-textarea {
        min-height: 100px;
    }

    .comment-item {
        padding: 15px;
    }

    .author-avatar {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

