/*
|--------------------------------------------------------------------------
| Comments Admin Styles
|--------------------------------------------------------------------------
*/

:root {
    --comments-primary: #6366f1;
    --comments-primary-light: rgba(99, 102, 241, 0.1);
    --comments-success: #10b981;
    --comments-success-light: rgba(16, 185, 129, 0.1);
    --comments-warning: #f59e0b;
    --comments-warning-light: rgba(245, 158, 11, 0.1);
    --comments-danger: #ef4444;
    --comments-danger-light: rgba(239, 68, 68, 0.1);
    --comments-info: #06b6d4;
    --comments-info-light: rgba(6, 182, 212, 0.1);
    --comments-dark-50: #f8fafc;
    --comments-dark-100: #f1f5f9;
    --comments-dark-200: #e2e8f0;
    --comments-dark-300: #cbd5e1;
    --comments-dark-400: #94a3b8;
    --comments-dark-500: #64748b;
    --comments-dark-600: #475569;
    --comments-dark-700: #334155;
    --comments-dark-800: #1e293b;
    --comments-radius: 12px;
    --comments-radius-sm: 8px;
}

/* Base container - ensure vertical layout */
.comments-admin {
    display: block;
    margin-top: 20px;
}

.comments-admin * {
    box-sizing: border-box;
}

/* Header */
.comments-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-top: 20px;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.comments-header-left {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.btn-back {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--comments-dark-200);
    border-radius: var(--comments-radius);
    color: var(--comments-dark-600);
    text-decoration: none;
    transition: all 0.2s;
}

.btn-back:hover {
    background: var(--comments-dark-50);
    color: var(--comments-dark-800);
}

.comments-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.comments-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--comments-dark-800);
    margin: 0;
}

.comments-badge {
    padding: 4px 12px;
    background: var(--comments-primary-light);
    color: var(--comments-primary);
    font-size: 12px;
    font-weight: 600;
    border-radius: 50px;
}

.comments-count {
    font-size: 14px;
    color: var(--comments-dark-500);
}

.comments-subtitle {
    font-size: 14px;
    color: var(--comments-dark-500);
    margin: 4px 0 0 0;
}

/* Stats */
.comments-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: white;
    border-radius: var(--comments-radius);
    border: 1px solid var(--comments-dark-100);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--comments-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.icon-primary { background: var(--comments-primary-light); color: var(--comments-primary); }
.stat-icon.icon-success { background: var(--comments-success-light); color: var(--comments-success); }
.stat-icon.icon-warning { background: var(--comments-warning-light); color: var(--comments-warning); }
.stat-icon.icon-danger { background: var(--comments-danger-light); color: var(--comments-danger); }
.stat-icon.icon-info { background: var(--comments-info-light); color: var(--comments-info); }

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--comments-dark-800);
}

.stat-label {
    font-size: 12px;
    color: var(--comments-dark-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Toolbar */
.comments-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    background: white;
    border-radius: var(--comments-radius);
    border: 1px solid var(--comments-dark-100);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.toolbar-left .btn-primary {
    white-space: nowrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.selected-count {
    font-size: 13px;
    color: var(--comments-dark-600);
    font-weight: 500;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--comments-dark-400);
}

.search-box input {
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--comments-dark-200);
    border-radius: var(--comments-radius-sm);
    font-size: 14px;
    min-width: 250px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--comments-primary);
    box-shadow: 0 0 0 3px var(--comments-primary-light);
}

.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filters .form-select {
    padding: 10px 36px 10px 12px;
    border: 1px solid var(--comments-dark-200);
    border-radius: var(--comments-radius-sm);
    font-size: 14px;
    min-width: 140px;
}

/* Comments Container */
.comments-container {
    background: white;
    border-radius: var(--comments-radius);
    border: 1px solid var(--comments-dark-100);
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
}

/* Comment Item */
.comment-item {
    border-bottom: 1px solid var(--comments-dark-100);
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    flex-shrink: 0;
}

.comment-item:last-child {
    border-bottom: none;
}

/* Replies container */
.comment-replies {
    padding-left: 60px;
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
}

/* Vertical line connecting replies */
.comment-replies::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 20px;
    width: 2px;
    background: var(--comments-dark-200);
}

/* Nested comment styling */
.comment-replies .comment-item {
    position: relative;
    background: var(--comments-dark-50);
    border-radius: var(--comments-radius-sm);
    margin-top: 16px;
    margin-bottom: 8px;
    border: 1px solid var(--comments-dark-100);
    border-bottom: 1px solid var(--comments-dark-100);
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    flex-shrink: 0;
}

/* Horizontal connector line */
.comment-replies .comment-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 32px;
    width: 28px;
    height: 2px;
    background: var(--comments-dark-200);
}

/* Reply badge */
.comment-replies .comment-item::after {
    content: 'ATSAKYMAS';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
    background: var(--comments-primary);
    color: white;
    border-radius: 4px;
    letter-spacing: 0.5px;
    z-index: 1;
}

/* Deeper nesting */
.comment-replies .comment-replies {
    padding-left: 40px;
}

.comment-replies .comment-replies::before {
    left: 20px;
    background: var(--comments-info);
}

.comment-replies .comment-replies .comment-item::before {
    left: -20px;
    width: 18px;
    background: var(--comments-info);
}

.comment-replies .comment-replies .comment-item::after {
    background: var(--comments-info);
    color: white;
}

/* Level 3 */
.comment-replies .comment-replies .comment-replies::before {
    background: var(--comments-success);
}

.comment-replies .comment-replies .comment-replies .comment-item::before {
    background: var(--comments-success);
}

.comment-replies .comment-replies .comment-replies .comment-item::after {
    background: var(--comments-success);
    color: white;
}

.comment-replies.collapsed {
    display: none;
}

.comment-main {
    display: flex;
    gap: 16px;
    padding: 20px;
}

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

.comment-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

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

.avatar-initials {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--comments-primary-light);
    color: var(--comments-primary);
    font-size: 14px;
    font-weight: 600;
    border-radius: 50%;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

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

.author-name {
    font-weight: 600;
    color: var(--comments-dark-800);
}

.author-badge {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--comments-success-light);
    color: var(--comments-success);
    border-radius: 50%;
    font-size: 10px;
}

.comment-email {
    font-size: 13px;
    color: var(--comments-dark-500);
}

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

.comment-rating .fa-star {
    font-size: 12px;
    color: var(--comments-dark-300);
}

.comment-rating .fa-star.filled {
    color: #fbbf24;
}

.comment-status {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
}

.status-pending { background: var(--comments-warning-light); color: var(--comments-warning); }
.status-approved { background: var(--comments-success-light); color: var(--comments-success); }
.status-rejected { background: var(--comments-danger-light); color: var(--comments-danger); }
.status-spam { background: var(--comments-dark-200); color: var(--comments-dark-600); }

.comment-date {
    font-size: 13px;
    color: var(--comments-dark-500);
}

.comment-date i {
    margin-right: 4px;
}

.comment-body {
    font-size: 14px;
    color: var(--comments-dark-700);
    line-height: 1.6;
    margin-bottom: 12px;
}

.comment-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.comment-actions {
    display: flex;
    gap: 6px;
}

.btn-action {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--comments-dark-200);
    border-radius: var(--comments-radius-sm);
    background: white;
    color: var(--comments-dark-500);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    font-size: 14px;
}

.btn-action:hover {
    background: var(--comments-dark-50);
}

.btn-action.btn-approve:hover,
.btn-approve:hover {
    background: var(--comments-success-light);
    color: var(--comments-success);
    border-color: var(--comments-success);
}

.btn-action.btn-reject:hover,
.btn-reject:hover {
    background: var(--comments-warning-light);
    color: var(--comments-warning);
    border-color: var(--comments-warning);
}

.btn-action.btn-reply:hover,
.btn-reply:hover {
    background: var(--comments-primary-light);
    color: var(--comments-primary);
    border-color: var(--comments-primary);
}

.btn-action.btn-spam:hover,
.btn-spam:hover {
    background: var(--comments-dark-200);
    color: var(--comments-dark-600);
}

.btn-action.btn-delete:hover,
.btn-delete:hover {
    background: var(--comments-danger-light);
    color: var(--comments-danger);
    border-color: var(--comments-danger);
}

.btn-toggle-replies {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--comments-primary);
    background: var(--comments-primary-light);
    border: none;
    border-radius: var(--comments-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-toggle-replies:hover {
    background: var(--comments-primary);
    color: white;
}

.btn-toggle-replies i {
    transition: transform 0.2s;
}

.btn-toggle-replies.collapsed i {
    transform: rotate(-90deg);
}

.comment-approved-info {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--comments-dark-200);
}

/* Empty State */
.comments-empty {
    padding: 60px 20px;
    text-align: center;
}

.comments-empty .empty-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--comments-dark-100);
    border-radius: 50%;
    margin: 0 auto 20px;
}

.comments-empty .empty-icon i {
    font-size: 32px;
    color: var(--comments-dark-400);
}

.comments-empty h3 {
    font-size: 18px;
    color: var(--comments-dark-700);
    margin: 0 0 8px 0;
}

.comments-empty p {
    font-size: 14px;
    color: var(--comments-dark-500);
    margin: 0;
}

/* Reply Modal */
.reply-to-info {
    padding: 12px;
    background: var(--comments-dark-50);
    border-radius: var(--comments-radius-sm);
    margin-bottom: 16px;
}

.reply-to-content {
    font-size: 14px;
    color: var(--comments-dark-600);
    font-style: italic;
    margin-top: 4px;
}

/* Pagination */
.comments-pagination {
    margin-top: 24px;
}

/* Responsive */
@media (max-width: 767px) {
    .comments-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .comments-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left, .toolbar-right {
        width: 100%;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 100%;
        min-width: unset;
    }

    .filters {
        width: 100%;
    }

    .filters .form-select {
        flex: 1;
        min-width: unset;
    }

    .comment-main {
        flex-direction: column;
        gap: 12px;
    }

    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .comment-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .comment-item[data-level="1"],
    .comment-item[data-level="2"],
    .comment-item[data-level="3"] {
        padding-left: 20px;
    }
}
