/**
 * Styles dla Komentarzy na Tablicy
 * Customer Management Plugin
 * ZGODNY ZE STYLEM LINK/VIDEO POPUP
 */

/* ============================================
   POPUP KOMENTARZY - MODAL
   ============================================ */

.comments-popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comments-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.comments-popup-content {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ============================================
   HEADER POPUP'A
   ============================================ */

.comments-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.comments-popup-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.comments-popup-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #666;
    transition: all 0.2s;
}

.comments-popup-close:hover {
    background: #f5f5f5;
}

/* ============================================
   BODY POPUP'A
   ============================================ */

.comments-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Post w popup'ie */
.comments-popup-post {
    margin-bottom: 20px;
}

.comments-popup-post .tablica-post {
    margin-bottom: 0;
    border: none;
    padding: 0;
}

.comments-popup-post .tablica-post:hover {
    box-shadow: none;
    background: transparent;
}

.comments-popup-post .post-actions {
    display: none;
}

/* Separator */
.comments-separator {
    height: 1px;
    background: #e5e5e5;
    margin: 20px 0;
}

/* ============================================
   POLE DODAWANIA KOMENTARZA
   ============================================ */

.comment-add-box {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.comment-add-avatar {
    flex-shrink: 0;
}

.comment-add-avatar img {
    border-radius: 50%;
    width: 32px;
    height: 32px;
}

.comment-add-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 60px;
    max-height: 150px;
    transition: all 0.2s;
    outline: none;
}

.comment-input:focus {
    border-color: #2271b1;
}

.comment-add-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.comment-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.comment-action-btn:hover {
    background: #f5f5f5;
}

/* ============================================
   PRZYCISK DODAWANIA KOMENTARZA
   ============================================ */

.comment-submit-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

.comment-submit-wrapper .tablica-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comment-submit-wrapper .tablica-btn-primary {
    background: #ffc107;
    color: #1a1a1a;
}

.comment-submit-wrapper .tablica-btn-primary:hover {
    background: #ffb300;
}

.comment-submit-wrapper .tablica-btn-primary:disabled {
    background: #e5e5e5;
    color: #999;
    cursor: not-allowed;
}

/* ============================================
   LISTA KOMENTARZY
   ============================================ */

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

.comments-loading,
.comments-error,
.comments-empty {
    text-align: center;
    padding: 32px 16px;
    color: #666;
    font-size: 15px;
}

.comments-error {
    color: #d63638;
}

/* ============================================
   POJEDYNCZY KOMENTARZ
   ============================================ */

.comment-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.2s;
}

.comment-item:hover {
    background: #f9f9f9;
}

.comment-avatar {
    flex-shrink: 0;
}

.comment-avatar img {
    border-radius: 50%;
    width: 32px;
    height: 32px;
}

.comment-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-author {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
}

.comment-date {
    font-size: 12px;
    color: #999;
}

.comment-content {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    word-wrap: break-word;
}

/* ============================================
   AKCJE KOMENTARZA
   ============================================ */

.comment-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 4px;
}

.comment-like-btn,
.comment-reply-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    font-weight: 500;
}

.comment-like-btn:hover,
.comment-reply-btn:hover {
    background: #e5e5e5;
    color: #333;
}

.comment-like-btn.liked {
    color: #2271b1;
}

.comment-like-btn.liked .like-icon {
    transform: scale(1.2);
}

.like-icon {
    font-size: 14px;
    transition: transform 0.2s;
}

.like-count {
    font-size: 13px;
    min-width: 16px;
    text-align: center;
}

/* ============================================
   ODPOWIEDZI
   ============================================ */

.comment-replies {
    margin-top: 12px;
    padding-left: 44px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-reply {
    background: #f5f5f5;
    border-left: 2px solid #ddd;
}

/* ============================================
   POLE ODPOWIEDZI
   ============================================ */

.comment-reply-box {
    margin-top: 12px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    gap: 12px;
}

.comment-reply-input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    min-height: 36px;
    max-height: 100px;
    transition: all 0.2s;
    outline: none;
}

.comment-reply-input:focus {
    border-color: #2271b1;
    background: #fff;
}

.comment-reply-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
}

.comment-reply-cancel-btn,
.comment-reply-submit-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.comment-reply-cancel-btn {
    background: #f5f5f5;
    color: #666;
}

.comment-reply-cancel-btn:hover {
    background: #e5e5e5;
    color: #333;
}

.comment-reply-submit-btn {
    background: #ffc107;
    color: #1a1a1a;
}

.comment-reply-submit-btn:hover {
    background: #ffb300;
}

.comment-reply-submit-btn:disabled {
    background: #e5e5e5;
    color: #999;
    cursor: not-allowed;
}

/* ============================================
   LICZNIK KOMENTARZY
   ============================================ */

.comment-count {
    display: inline-block;
    margin-left: 4px;
    color: #666;
    font-size: 13px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .comments-popup-content {
        width: 95%;
        max-width: 100%;
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .comments-popup-header {
        padding: 16px;
    }
    
    .comments-popup-body {
        padding: 16px;
    }
    
    .comment-replies {
        padding-left: 24px;
    }
    
    .comment-add-actions {
        flex-wrap: wrap;
    }
}