/**
 * Review Comments Styles
 *
 * Styling für das Kommentar-System mit verschachtelter Antwort-Funktionalität
 *
 * @package UserAccountHub
 * @since 5.5.0
 */

/* ========================================
   Kommentar-Sektion
   ======================================== */

.uah-comments-section {
    margin-top: 40px;
    padding: 40px 0;
    border-top: 1px solid #e0e0e0;
}

.uah-comments-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 30px;
}

/* ========================================
   Kommentar-Formular
   ======================================== */

.uah-comment-form-wrapper {
    margin-bottom: 40px;
}

.uah-comment-form {
    position: relative;
    /* Für absolute Button-Positionierung */
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

/* Form Input Wrapper: Avatar + Textarea horizontal */
.uah-comment-form-input-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.uah-comment-avatar {
    flex-shrink: 0;
    border-radius: 50%;
    width: 48px;
    height: 48px;
}

.uah-comment-input-container {
    flex: 1;
    min-width: 0;
}

.uah-comment-author {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.uah-comment-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.6;
    resize: none;
    transition: border-color 0.2s ease;
    /* Nur border-color, kein padding */
}

.uah-comment-textarea:focus {
    outline: none;
    border-color: #2ECC40;
}

.uah-comment-textarea::placeholder {
    color: #999;
}

.uah-comment-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 12px;
    overflow: hidden;
    /* Keine Transitions - instant show/hide */
}

/* ========================================
   USERNAME - NUR IM FORMULAR VERSTECKT
   ======================================== */
.uah-comment-form .uah-comment-author,
.uah-reply-form .uah-comment-author {
    display: none !important;
}

/* ========================================
   COLLAPSED STATE (Default)
   ======================================== */
.uah-form-collapsed .uah-comment-textarea {
    height: 52px !important;
    /* Überschreibt Theme 3rem */
    min-height: 52px !important;
    padding-bottom: 12px !important;
    /* Reset padding vom expanded state */
}

.uah-form-collapsed .uah-comment-form-actions {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
    /* Verhindert Klicks im collapsed state */
}

/* ========================================
   EXPANDED STATE
   ======================================== */
.uah-form-expanded .uah-comment-textarea {
    min-height: 200px;
    height: auto !important;
    /* Erlaubt Auto-Resize */
    resize: vertical;
    padding-bottom: 50px;
    /* Platz für Button rechts unten */
}

.uah-form-expanded .uah-comment-input-container {
    position: relative;
    /* Für absolute Button-Positionierung */
}

.uah-form-expanded .uah-comment-form-actions {
    position: absolute;
    right: 12px;
    bottom: 12px;
    max-height: none;
    opacity: 1;
    margin-top: 0;
    pointer-events: auto;
}

/* Character Counter */
.uah-char-counter {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
    text-align: right;
}

.uah-char-counter-over {
    color: #e74c3c;
    font-weight: 600;
}

/* ========================================
   Login-Hinweis
   ======================================== */

.uah-comment-login-notice {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-bottom: 40px;
}

.uah-comment-login-notice p {
    margin: 0;
    color: #555;
}

.uah-comment-login-notice a {
    color: #2ECC40;
    text-decoration: none;
    font-weight: 600;
}

.uah-comment-login-notice a:hover {
    text-decoration: underline;
}

/* ========================================
   Kommentar-Liste
   ======================================== */

.uah-comments-list {
    margin-top: 30px;
}

.uah-no-comments {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* ========================================
   Kommentar-Thread (verschachtelt)
   ======================================== */

.uah-comments-thread {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Einrückung für verschachtelte Kommentare */
.uah-comments-thread[data-depth="1"] {
    margin-left: calc(48px + 20px);
}

.uah-comments-thread[data-depth="2"] {
    margin-left: calc(48px + 20px);
}

.uah-comments-thread[data-depth="3"] {
    margin-left: calc(48px + 20px);
}

/* ========================================
   Einzelner Kommentar
   ======================================== */

.uah-comment {
    display: flex;
    gap: 12px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.uah-comment:hover {
    background: #f8f9fa;
}

/* Highlight-Effekt für Direkt-Links */
.uah-comment-highlight {
    background: #fff9e6 !important;
    animation: uah-highlight-fade 2s ease;
}

@keyframes uah-highlight-fade {
    0% {
        background: #ffeb99;
    }

    100% {
        background: #fff9e6;
    }
}

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

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

.uah-comment-body {
    flex: 1;
    min-width: 0;
    /* Verhindert Overflow */
}

.uah-comment-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

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

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

.uah-comment-text {
    color: #555;
    line-height: 1.6;
    margin-bottom: 12px;
    word-wrap: break-word;
}

.uah-comment-text p {
    margin: 0 0 12px 0;
}

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

/* Edit Form */
.uah-edit-form-wrapper {
    margin-top: 12px;
    position: relative;
    /* Für absolute Button-Positionierung */
}

.uah-edit-form-wrapper .uah-comment-input-container {
    position: relative;
    /* Für absolute Button-Positionierung */
}

.uah-edit-textarea {
    width: 100%;
    min-height: 200px;
    height: auto;
    padding-bottom: 50px;
    /* Platz für Buttons rechts unten */
}

.uah-edit-form-wrapper .uah-comment-form-actions {
    position: absolute;
    right: 12px;
    bottom: 12px;
    margin-top: 0;
}

/* ========================================
   Kommentar-Aktionen
   ======================================== */

.uah-comment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.uah-reply-button,
.uah-edit-button,
.uah-delete-button,
.uah-report-comment {
    background: none;
    border: none;
    padding: 0;
    color: #999;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}

.uah-reply-button:hover,
.uah-edit-button:hover {
    color: #2ECC40;
}

.uah-delete-button:hover,
.uah-report-comment:hover {
    color: #e74c3c;
}

/* Vote Buttons */
.uah-comment-vote-btn {
    background: none;
    border: none;
    padding: 0;
    color: #999;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.uah-comment-vote-btn i {
    font-size: 12px;
}

.uah-comment-vote-btn:hover {
    color: #2ECC40;
}

.uah-comment-vote-btn.uah-voted {
    color: #2ECC40;
    font-weight: 700;
}

.uah-vote-not-helpful:hover {
    color: #e74c3c;
}

.uah-vote-not-helpful.uah-voted {
    color: #e74c3c;
}

.uah-vote-count {
    font-size: 12px;
    opacity: 0.8;
}

.uah-comment-actions-separator {
    color: #ccc;
    font-size: 10px;
}

/* ========================================
   Antwort-Formular (verschachtelt)
   ======================================== */

.uah-reply-form-wrapper {
    margin-top: 20px;
}

.uah-reply-form {
    position: relative;
    /* Für absolute Button-Positionierung */
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
}

.uah-reply-form .uah-comment-avatar {
    width: 32px;
    height: 32px;
}

.uah-reply-form .uah-comment-input-container {
    position: relative;
    /* Für absolute Button-Positionierung */
}

.uah-reply-form .uah-comment-textarea {
    min-height: 200px;
    /* Feste Höhe, kein Expand/Collapse */
    height: auto;
    padding-bottom: 50px;
    /* Platz für Buttons rechts unten */
}

.uah-reply-form .uah-comment-form-actions {
    position: absolute;
    right: 12px;
    bottom: 12px;
    margin-top: 0;
}

/* ========================================
   Buttons
   ======================================== */

.uah-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.uah-btn-primary {
    background: #2ECC40;
    color: white;
}

.uah-btn-primary:hover:not(:disabled) {
    background: #26a829;
}

.uah-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.uah-btn-secondary {
    background: #fff;
    color: #555;
    border: 1px solid #e0e0e0;
}

.uah-btn-secondary:hover:not(:disabled) {
    background: #f8f9fa;
}

.uah-btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Save/Cancel Edit Buttons */
.uah-save-edit,
.uah-cancel-edit {
    margin-right: 8px;
}

/* ========================================
   Load More Button
   ======================================== */

.uah-load-more-comments {
    display: block;
    margin: 40px auto 0;
    padding: 12px 32px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #2ECC40;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.uah-load-more-comments:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #2ECC40;
}

.uah-load-more-comments:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet */
@media (max-width: 767px) {

    .uah-comments-thread[data-depth="1"],
    .uah-comments-thread[data-depth="2"],
    .uah-comments-thread[data-depth="3"] {
        margin-left: calc(32px + 16px);
    }

    .uah-comment-avatar img.avatar {
        width: 40px;
        height: 40px;
    }

    .uah-comment {
        padding: 16px;
    }
}

/* Mobile */
@media (max-width: 479px) {
    .uah-comments-section {
        padding: 30px 0;
    }

    .uah-comments-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .uah-comment-form,
    .uah-reply-form {
        padding: 16px;
    }

    .uah-comment-avatar {
        width: 32px;
        height: 32px;
    }

    .uah-reply-form .uah-comment-avatar {
        width: 24px;
        height: 24px;
    }

    .uah-form-collapsed .uah-comment-textarea {
        min-height: 32px;
    }

    .uah-reply-form.uah-form-collapsed .uah-comment-textarea {
        min-height: 24px;
    }

    .uah-comments-thread[data-depth="1"],
    .uah-comments-thread[data-depth="2"],
    .uah-comments-thread[data-depth="3"] {
        margin-left: 20px;
    }

    .uah-comment {
        gap: 8px;
        padding: 16px;
    }

    .uah-comment-textarea {
        min-height: 60px;
        font-size: 14px;
    }

    .uah-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .uah-comment-actions {
        gap: 8px;
    }
}

/* ========================================
   Loading State
   ======================================== */

.uah-comments-loading {
    text-align: center;
    padding: 40px;
}

.uah-comments-loading::after {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #2ECC40;
    border-radius: 50%;
    animation: uah-spin 0.8s linear infinite;
}

@keyframes uah-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Empty State
   ======================================== */

.uah-comments-empty {
    text-align: center;
    padding: 40px;
    color: #999;
}

.uah-comments-empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* ========================================
   Admin Badges
   ======================================== */

.uah-comment-admin-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #2ECC40;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    margin-left: 8px;
}

.uah-comment-vendor-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #3498db;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    margin-left: 8px;
}

.uah-comment-author-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #9b59b6;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    margin-left: 8px;
}

/* ========================================
   Dashboard & Profile Comment Links
   ======================================== */

.uah-review-comments-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2ECC40;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.uah-review-comments-link:hover {
    color: #26a829;
    text-decoration: underline;
}

.vote-item.vote-comments a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vote-item.vote-comments a:hover {
    opacity: 0.8;
}