/* ============================================
   COMMENTS & REVIEWS SYSTEM CSS
   YouTube-Style Comment UI for TENZOSKA
   ============================================ */

/* ============================================
   MOMENT COMMENTS SECTION
   ============================================ */

.moment-comments-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.moment-comments-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-secondary, #64748b);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.moment-comments-toggle:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-dark, #2563eb);
}

.moment-comments-toggle i {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.moment-comments-toggle.expanded i {
    transform: rotate(180deg);
}

.moment-comments-container {
    display: none;
    padding: 12px;
    background: rgba(248, 250, 252, 0.5);
    border-radius: 12px;
    margin-top: 8px;
}

.moment-comments-container.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Comment Input Section */
.comment-input-section {
    margin-bottom: 16px;
}

.comment-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.comment-input-wrapper input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.comment-input-wrapper input:focus {
    border-color: var(--primary-dark, #2563eb);
}

.comment-input-wrapper button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-dark, #2563eb);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.comment-input-wrapper button:hover {
    background: #1d4ed8;
    transform: scale(1.1);
}

.comment-login-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 12px;
    color: #856404;
    font-size: 14px;
    font-weight: 500;
}

/* Comments List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.comment-item.hidden {
    display: none;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-dark, #2563eb), var(--accent-purple, #8b5cf6));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    align-self:flex-start;
}

.comment-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-author {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary, #1e293b);
}

.comment-time {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
}

.comment-text {
    font-size: 14px;
    color: var(--text-secondary, #64748b);
    line-height: 1.5;
    word-wrap: break-word;
    width: 100%;
}

/* Read More Button */
.read-more-comments {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: none;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    color: var(--primary-dark, #2563eb);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.read-more-comments:hover {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--primary-dark, #2563eb);
}

/* Loading & Empty States */
.comments-loading,
.reviews-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted, #94a3b8);
    font-size: 14px;
}

.comments-loading::after,
.reviews-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid var(--border-color, #e2e8f0);
    border-top-color: var(--primary-dark, #2563eb);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   PROJECT REVIEWS SECTION
   ============================================ */

.project-reviews-section {
    padding: 60px 20px;
    background: linear-gradient(180deg, var(--bg-primary, #f8fafc) 0%, var(--bg-secondary, #f1f5f9) 100%);
    margin-top: 60px;
}

.reviews-section-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin-bottom: 8px;
}

.reviews-section-subtitle {
    text-align: center;
    font-size: 16px;
    color: var(--text-secondary, #64748b);
    margin-bottom: 40px;
}

/* Review Form */
.review-form-container {
    max-width: 600px;
    margin: 0 auto 40px;
    padding: 24px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#review-form-container {
    display: none;
}

.review-login-message {
    text-align: center;
    padding: 24px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 12px;
    color: #856404;
    font-size: 15px;
    font-weight: 500;
}

#review-login-message {
    display: block;
}

.review-textarea {
    width: 100%;
    min-height: 100px;
    padding: 16px;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s ease;
    margin-bottom: 16px;
}

.review-textarea:focus {
    border-color: var(--primary-dark, #2563eb);
}

.review-submit-btn {
    display: block;
    width: 100%;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary-dark, #2563eb), var(--accent-purple, #8b5cf6));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.review-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

/* Reviews List */
.reviews-container {
    max-width: 800px;
    margin: 0 auto;
}

.review-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted, #94a3b8);
    font-size: 15px;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-card {
    padding: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.review-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.review-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-teal, #14b8a6), var(--accent-cyan, #06b6d4));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.review-user-info {
    flex: 1;
}

.review-author {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary, #1e293b);
}

.review-time {
    font-size: 13px;
    color: var(--text-muted, #94a3b8);
}

.review-content {
    font-size: 15px;
    color: var(--text-secondary, #64748b);
    line-height: 1.6;
    word-wrap: break-word;
}

/* ============================================
   MOBILE OPTIMIZATION (HP)
   ============================================ */

@media (max-width: 768px) {
    /* Moment Comments - Mobile */
    .moment-comments-toggle {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .moment-comments-container {
        padding: 10px;
    }
    
    .comment-input-wrapper input {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .comment-input-wrapper button {
        width: 36px;
        height: 36px;
    }
    
    .comment-avatar {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 12px;
    }
    
    .comment-author {
        font-size: 12px;
    }
    
    .comment-time {
        font-size: 11px;
    }
    
    .comment-text {
        font-size: 13px;
    }
    
    .comment-item {
        padding: 12px;
        margin-left: 4px;
        margin-right: 4px;
    }
    
    /* Project Reviews - Mobile */
    .project-reviews-section {
        padding: 40px 16px;
        margin-top: 40px;
    }
    
    .reviews-section-title {
        font-size: 24px;
    }
    
    .reviews-section-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .review-form-container {
        padding: 16px;
        margin-bottom: 24px;
    }
    
    .review-textarea {
        min-height: 80px;
        font-size: 14px;
    }
    
    .review-submit-btn {
        padding: 12px 24px;
        font-size: 15px;
    }
    
    .review-card {
        padding: 16px;
    }
    
    .review-avatar {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .review-author {
        font-size: 14px;
    }
    
    .review-time {
        font-size: 12px;
    }
    
    .review-content {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    /* Even smaller screens */
    .reviews-section-title {
        font-size: 22px;
    }
    
    .review-form-container {
        padding: 14px;
    }
    
    .review-card {
        padding: 14px;
    }
    
    .comment-input-wrapper {
        flex-direction: column;
    }
    
    .comment-input-wrapper input {
        width: 100%;
    }
    
    .comment-input-wrapper button {
        width: 100%;
        border-radius: 24px;
    }
    
    .comment-item {
        padding: 10px;
        margin-left: 2px;
        margin-right: 2px;
    }
}

/* ============================================
   MODAL COMMENTS SECTION
   ============================================ */
   

.modal-comments-section {
    width: 90%;
    max-width: 600px;
    max-height: 50vh;
    overflow-y: auto;
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin: 20px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-comments-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.modal-comments-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}

.modal-comments-header i {
    color: var(--primary-dark, #2563eb);
}

.modal-comment-input {
    margin-bottom: 16px;
}

.modal-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.modal-input-wrapper input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.modal-input-wrapper input:focus {
    border-color: var(--primary-dark, #2563eb);
}

.modal-input-wrapper button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-dark, #2563eb);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-input-wrapper button:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

.modal-login-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 12px;
    color: #856404;
    font-size: 14px;
    font-weight: 500;
}

.modal-comments-list {
    max-height: 300px;
    overflow-y: auto;
}

.modal-comments-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-comment-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: rgba(248, 250, 252, 0.5);
    border-radius: 12px;
}

.modal-comment-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-dark, #2563eb), var(--accent-purple, #8b5cf6));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.modal-comment-content {
    flex: 1;
    min-width: 0;
}

.modal-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.modal-comment-author {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary, #1e293b);
}

.modal-comment-time {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    flex: 1;
}

.modal-comment-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-comment-delete-btn:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.modal-comment-text {
    font-size: 14px;
    color: var(--text-secondary, #64748b);
    line-height: 1.5;
    word-wrap: break-word;
}

.modal-no-comments {
    text-align: center;
    padding: 20px;
    color: var(--text-muted, #94a3b8);
    font-size: 14px;
}

/* Modal Media Container */
.modal-media-container {
    max-width: 90%;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: auto;
}

.modal-media-container .modal-content {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
}

.modal-media-container #caption {
    margin-top: 10px;
    font-size: 16px;
    color: white;
    text-align: center;
}
.modal {
    display: none;
    flex-direction: column;
    align-items: center;
    position:fixed;
    inset:0;
    background: rgba(0, 0, 0, 0.8);
    z-index:9999;
    justify-content: center;
}

@media (max-width: 768px) {
   .modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;

    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    padding: 20px 10px;
    }

    .modal-comments-section {
    width: 90%;
    max-width: 600px;
    margin-top: 20px;
    }

}