/**
 * NeoWP Taxonomy Comments Styles
 */

/* Main comments section */
.neowp-comments-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Comments header */
.neowp-comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.neowp-comments-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.neowp-add-comment-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.neowp-add-comment-btn:hover {
    background: #005a87;
}

/* Comments list */
.neowp-comments-list {
    margin-bottom: 2rem;
}

.neowp-no-comments {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* Individual comment item */
.neowp-comment-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    position: relative;
}

.neowp-comment-item:last-child {
    margin-bottom: 0;
}

/* Comment avatar */
.neowp-comment-avatar {
    flex-shrink: 0;
}

.neowp-comment-avatar img {
    border-radius: 50%;
    border: 2px solid #ddd;
}

/* Comment content */
.neowp-comment-content {
    flex: 1;
    min-width: 0;
}

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

.neowp-comment-author {
    font-weight: 600;
    color: #333;
}

.neowp-comment-author a {
    color: #0073aa;
    text-decoration: none;
}

.neowp-comment-author a:hover {
    text-decoration: underline;
}

.neowp-comment-registered-user {
    display: inline-block;
    margin-right: 0.5rem;
    color: #00a32a;
    font-size: 0.8rem;
}

.neowp-comment-meta {
    font-size: 0.85rem;
    color: #666;
}

.neowp-comment-meta time {
    margin-left: 0.5rem;
}

.neowp-comment-permalink {
    color: #666;
    text-decoration: none;
    margin-right: 0.5rem;
}

.neowp-comment-permalink:hover {
    color: #0073aa;
}

/* Comment text */
.neowp-comment-text {
    margin: 1rem 0;
    line-height: 1.6;
    color: #444;
}

.neowp-comment-text p {
    margin-bottom: 1rem;
}

.neowp-comment-text p:last-child {
    margin-bottom: 0;
}

/* Comment actions */
.neowp-comment-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.neowp-comment-actions button {
    background: none;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #666;
    transition: all 0.3s ease;
}

.neowp-comment-actions button:hover {
    background: #f5f5f5;
    border-color: #bbb;
    color: #333;
}

.neowp-reply-btn:hover {
    background: #e7f3ff;
    border-color: #0073aa;
    color: #0073aa;
}

.neowp-edit-comment-btn:hover {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.neowp-delete-comment-btn:hover {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.neowp-moderate-comment-btn:hover {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

/* Comment replies */
.neowp-comment-replies {
    margin-top: 1.5rem;
    padding-right: 2rem;
    border-right: 3px solid #e0e0e0;
}

.neowp-comment-reply {
    margin-bottom: 1.5rem;
}

.neowp-comment-reply:last-child {
    margin-bottom: 0;
}

.neowp-comment-reply .neowp-comment-item {
    background: #f0f0f0;
    border-color: #d0d0d0;
}

/* Reply form container */
.neowp-reply-form-container {
    margin-top: 1rem;
    padding: 1rem;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

/* Comment form */
.neowp-comment-form-wrapper {
    background: #fff;
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.neowp-reply-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #e7f3ff;
    border-radius: 4px;
}

.neowp-reply-info p {
    margin: 0;
    color: #0073aa;
}

.neowp-cancel-reply {
    background: #666;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.neowp-cancel-reply:hover {
    background: #555;
}

/* Form fields */
.neowp-form-fields {
    margin-bottom: 1.5rem;
}

.neowp-form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.neowp-form-field {
    margin-bottom: 1rem;
    flex: 1;
}

.neowp-form-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.neowp-form-field input,
.neowp-form-field textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.neowp-form-field input:focus,
.neowp-form-field textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

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

.neowp-form-help {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Logged in user info */
.neowp-logged-in-user {
    margin-bottom: 1rem;
}

.neowp-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f0f6fc;
    border: 1px solid #c6e2ff;
    border-radius: 4px;
}

.neowp-user-info img {
    border-radius: 50%;
}

.neowp-user-name {
    font-weight: 600;
    color: #0073aa;
}

.neowp-logout-link {
    margin-right: auto;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
}

.neowp-logout-link:hover {
    color: #dc3545;
    text-decoration: underline;
}

/* Form actions */
.neowp-form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.neowp-submit-comment {
    background: #0073aa;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.neowp-submit-comment:hover {
    background: #005a87;
}

.neowp-submit-comment:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Form messages */
.neowp-form-messages {
    margin-top: 1rem;
}

.neowp-form-success,
.neowp-form-error,
.neowp-form-loading {
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.neowp-form-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.neowp-form-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.neowp-form-loading {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d1d3d6;
    text-align: center;
}

/* Pagination */
.neowp-comments-pagination {
    text-align: center;
    margin: 2rem 0;
}

.neowp-load-more-comments {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #ddd;
    padding: 1rem 2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.neowp-load-more-comments:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.neowp-load-more-comments:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

/* Login required message */
.neowp-login-required {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    color: #495057;
}

.neowp-login-required a {
    color: #0073aa;
    text-decoration: none;
}

.neowp-login-required a:hover {
    text-decoration: underline;
}

/* Auto-injected comments */
.neowp-auto-injected-comments {
    margin-top: 3rem;
}

/* Modal styles */
.neowp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
}

.neowp-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.neowp-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

/* Responsive design */
@media (max-width: 768px) {
    .neowp-comments-section {
        margin: 1rem 0;
        padding: 1rem;
    }

    .neowp-comments-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .neowp-comment-item {
        flex-direction: column;
        gap: 1rem;
    }

    .neowp-comment-avatar {
        align-self: flex-start;
    }

    .neowp-form-row {
        flex-direction: column;
        gap: 0;
    }

    .neowp-comment-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .neowp-comment-actions button {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .neowp-comment-replies {
        padding-right: 1rem;
    }

    .neowp-modal-content {
        width: 95%;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .neowp-comments-title {
        font-size: 1.2rem;
    }

    .neowp-comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .neowp-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .neowp-user-info {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}