/**
 * Comment System Styles
 * Standalone CSS for the comment system feature
 * Used in conjunction with comment-system.js and api-comment.php
 */

/* Comment Section Container */
.comment-section {
    background: white;
    padding: 50px 50px 30px 50px;
    margin: 0 !important;
    width: 100%;
    box-sizing: border-box;
}

.comment-section h2 {
    font-size: 2.2em;
    text-align: center;
    color: #1f2937;
    margin-bottom: 10px;
}

.comment-disclaimer {
    text-align: center;
    color: #9ca3af;
    font-size: 0.9em;
    margin-bottom: 30px;
    font-style: italic;
}

/* Control Buttons */
.comment-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: center;
    align-items: center;
}

.comment-control-btn {
    flex: 1;
    max-width: 400px;
    padding: 15px 30px;
    background: white;
    color: #8b5cf6;
    border: 2px solid #8b5cf6;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.comment-control-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: #6b21a8;
    color: #6b21a8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.comment-control-btn:active {
    transform: translateY(0);
}

/* Comment Form */
.comment-form-container {
    margin-bottom: 30px;
    padding: 30px;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 1000px;
    }
}

.comment-form-container h3 {
    color: #1f2937;
    font-size: 1.3em;
    margin-bottom: 20px;
}

.comment-form-container form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-form-container textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 1em;
    font-family: 'Arial', sans-serif;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.comment-form-container textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.comment-form-container input[type="text"],
.comment-form-container input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.comment-form-container input[type="text"]:focus,
.comment-form-container input[type="email"]:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Honeypot field (hidden) */
.comment-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.comment-submit-btn {
    align-self: center;
    padding: 15px 50px;
    background: white;
    color: #8b5cf6;
    border: 2px solid #8b5cf6;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 200px;
}

.comment-submit-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: #6b21a8;
    color: #6b21a8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.comment-submit-btn:active {
    transform: translateY(0);
}

.comment-submit-btn:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    border-color: #d1d5db;
    cursor: not-allowed;
    box-shadow: none;
}

/* Comments List */
.comments-list {
    margin: 40px 0;
    min-height: 200px;
}

.comment-card {
    background: white;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    border-top: none;
    border-bottom: none;
    border-radius: 0;
    margin-bottom: 0;
    box-shadow: none;
    transition: none;
    position: relative;
    padding-bottom: 5px;
    padding-top: 5px;
}

/* Separator line - 95% width, appears AFTER entire comment section (including replies) */
.comment-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    height: 1px;
    background-color: #e5e7eb;
}

.comment-card:first-child {
    border-top: 1px solid #e5e7eb;
    border-radius: 10px 10px 0 0;
}

.comment-card:last-child {
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0 0 10px 10px;
}

.comment-card:last-child::after {
    display: none;
}

.comment-card:only-child {
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 10px;
}

.comment-card:only-child::after {
    display: none;
}

.comment-card:hover {
    box-shadow: none;
}

.comment-card-content {
    display: flex;
    gap: 15px;
    padding: 25px;
}

.comment-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    flex-shrink: 0;
    overflow: hidden;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.comment-username {
    font-weight: bold;
    color: #1f2937;
    font-size: 1.05em;
}

.comment-user-type {
    font-size: 0.85em;
    color: #8b5cf6;
    font-weight: 600;
    padding: 2px 8px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 4px;
}

.comment-timestamp {
    font-size: 0.85em;
    color: #9ca3af;
    margin-bottom: 12px;
}

.comment-text {
    color: #1f2937;
    line-height: 1.6;
    margin-bottom: 15px;
}

.comment-actions {
    display: flex;
    gap: 20px;
}

.comment-helpful,
.comment-reply {
    background: none;
    border: none;
    color: #8b5cf6;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.comment-helpful:hover,
.comment-reply:hover {
    background: rgba(139, 92, 246, 0.1);
    color: #6b21a8;
}

.comment-helpful.liked {
    color: #ec4899;
}

/* Nested Reply Styling */
.comment-replies {
    margin-left: 40px;
    margin-top: 5px;
    margin-bottom: 0;
    padding-left: 20px;
    padding-bottom: 0;
    border-left: 3px solid rgba(139, 92, 246, 0.3);
}

.comment-reply-card {
    background: transparent;
    border: none !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    box-shadow: none;
    margin-bottom: 5px;
    padding: 0;
    padding-bottom: 0;
}

.comment-reply-card::after {
    display: none !important;
}

.comment-reply-card::before {
    display: none !important;
}

.comment-reply-card:last-child {
    margin-bottom: 0;
}

.comment-reply-card:hover {
    box-shadow: none;
}

.comment-reply-card .comment-card-content {
    padding: 15px 0;
}

.comment-reply-container {
    margin-left: 60px;
    margin-top: 15px;
    padding-left: 20px;
    border-left: 3px solid rgba(139, 92, 246, 0.3);
}

/* Reply Form Container */
.comment-reply-form-container {
    width: 100%;
}

/* Reply Form Styling */
.reply-form-wrapper {
    margin: 0;
    padding: 25px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.reply-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.reply-form-header h4 {
    margin: 0;
    color: #1f2937;
    font-size: 1.2em;
    font-weight: 600;
}

.cancel-reply-link {
    color: #ef4444;
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 500;
    transition: color 0.2s ease;
}

.cancel-reply-link:hover {
    color: #dc2626;
    text-decoration: underline;
}

.reply-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reply-form textarea,
.reply-form input[type="text"],
.reply-form input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 1em;
    font-family: 'Arial', sans-serif;
    transition: border-color 0.3s ease;
}

.reply-form textarea {
    min-height: 150px;
    resize: vertical;
}

.reply-form textarea:focus,
.reply-form input[type="text"]:focus,
.reply-form input[type="email"]:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* View All Comments Button */
.view-all-comments-btn {
    display: block;
    width: 100%;
    max-width: 600px;
    margin: 30px auto;
    padding: 15px 30px;
    background: white;
    color: #8b5cf6;
    border: 2px solid #8b5cf6;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.view-all-comments-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: #6b21a8;
    color: #6b21a8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.view-all-comments-btn:active {
    transform: translateY(0);
}

/* Empty State */
.comment-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 1.1em;
}

/* Loading Spinner */
.comment-loading {
    text-align: center;
    padding: 40px;
    color: #8b5cf6;
    font-size: 1em;
}

/* Mobile Responsive - Comment Section */
@media (max-width: 767px) {
    .comment-section {
        padding: 30px 20px;
    }

    .comment-section h2 {
        font-size: 1.6em;
    }

    .comment-controls {
        flex-direction: column;
        gap: 15px;
    }

    .comment-control-btn {
        max-width: 100%;
        width: 100%;
    }

    .comment-form-container {
        padding: 20px;
    }

    .comment-form-container h3 {
        font-size: 1.1em;
    }

    .comment-form-container textarea {
        min-height: 150px;
        font-size: 0.95em;
    }

    .comment-submit-btn {
        width: 100%;
        min-width: unset;
        padding: 12px 30px;
        font-size: 1em;
    }

    .comment-card-content {
        flex-direction: column;
        padding: 20px;
    }

    .comment-avatar {
        width: 40px;
        height: 40px;
    }

    .comment-username {
        font-size: 1em;
    }

    .comment-replies {
        margin-left: 20px;
        padding-left: 15px;
        border-left: 2px solid rgba(139, 92, 246, 0.3);
    }

    .comment-reply-card .comment-card-content {
        padding: 10px 0;
    }

    .comment-reply-container {
        margin-left: 20px;
        padding-left: 15px;
    }

    .view-all-comments-btn {
        width: 100%;
        font-size: 1em;
    }

    /* Reply Form Mobile */
    .reply-form-wrapper {
        padding: 20px;
    }

    .reply-form-header h4 {
        font-size: 1.1em;
    }

    .cancel-reply-link {
        font-size: 0.9em;
    }

    .reply-form textarea {
        min-height: 120px;
    }
}

/* Tablet Responsive - Comment Section */
@media (min-width: 768px) and (max-width: 1024px) {
    .comment-section {
        padding: 40px 30px;
    }

    .comment-section h2 {
        font-size: 2em;
    }

    .comment-form-container {
        padding: 25px;
    }

    .comment-card-content {
        padding: 22px;
    }

    .comment-replies {
        margin-left: 30px;
        padding-left: 18px;
    }

    .comment-reply-container {
        margin-left: 50px;
    }
}
