/**
 * Comment System Styles
 * Version: 1.0.0
 */

/* Comment Container */
#comment-system-container {
    margin: 40px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Comment Header */
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}


.comment-header h3 {
    margin: 0;
    font-weight: 700;
    font-size: 1.6em;
    color: #2c3e50;
    line-height: 1.4;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.comment-header .refresh-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #dee2e6;
    padding: 10px 20px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.comment-header .refresh-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #adb5bd;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.comment-header .refresh-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comment-header .refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Dark theme header */
.comment-header.dark {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.comment-header.dark:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.comment-header.dark h3 {
    color: #ffc107;
    text-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.comment-header.dark .refresh-btn {
    background: linear-gradient(135deg, #343a40 0%, #2d2d2d 100%);
    border-color: #495057;
    color: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.comment-header.dark .refresh-btn:hover {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    border-color: #6c757d;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Comment User Info */
.comment-user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.comment-user-info:hover {
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.user-info-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.comment-user-info:hover .user-avatar {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    border-color: #ff9800;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.3;
}

.user-email {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.user-info-right {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 10px 18px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 2px solid;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-edit-name {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #495057;
    border-color: #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-edit-name:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #adb5bd;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.btn-logout {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border-color: #ff9800;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.btn-logout:hover {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    border-color: #f57c00;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.4);
}

/* Comment Form */
.comment-form {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 40px;
    border-radius: 24px;
    margin-bottom: 40px;
    border: 2px solid #e9ecef;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.comment-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #ff9800, #ffc107, #4caf50, #2196f3);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.comment-form:hover::before {
    opacity: 1;
}

.comment-form:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 6px 20px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.comment-form.dark {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    border-color: #495057;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.comment-form.dark:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 6px 20px rgba(0, 0, 0, 0.4);
}

.comment-form textarea {
    width: 100%;
    min-height: 140px;
    padding: 20px 24px;
    border: 2px solid #dee2e6;
    border-radius: 20px;
    resize: vertical;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.7;
    font-weight: 400;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.06);
}

.comment-form textarea:hover {
    border-color: #ced4da;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.08);
}

.comment-form textarea::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

.comment-form.dark textarea {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-color: #495057;
    color: #f8f9fa;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.3);
}

.comment-form.dark textarea:hover {
    border-color: #6c757d;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.4);
}

.comment-form.dark textarea::placeholder {
    color: #6c757d;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #ff9800;
    box-shadow: 0 0 0 5px rgba(255, 152, 0, 0.15), inset 0 3px 6px rgba(0, 0, 0, 0.06);
    transform: translateY(-3px);
    background: #ffffff;
}

.comment-form.dark textarea:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 5px rgba(255, 193, 7, 0.2), inset 0 3px 6px rgba(0, 0, 0, 0.3);
    background: #2d2d2d;
}

.comment-form .form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.comment-form.dark .form-footer {
    border-top-color: #495057;
}

.comment-form .char-count {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.comment-form.dark .char-count {
    color: #adb5bd;
}

.comment-form button[type="submit"] {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    overflow: hidden;
}

.comment-form button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.comment-form button[type="submit"]:hover::before {
    left: 100%;
}

.comment-form button[type="submit"]:hover {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 32px rgba(255, 152, 0, 0.45);
}

.comment-form button[type="submit"]:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.35);
}

.comment-form button[type="submit"]:disabled {
    background: linear-gradient(135deg, #dee2e6 0%, #adb5bd 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0.6;
}

.comment-form.dark button[type="submit"]:disabled {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
}

/* ===== COMMENTS LIST ===== */
#comments-list {
    margin: 40px 0;
}

/* ===== COMMENT ITEMS - Copy từ rating-system.css (dòng 727-797) ===== */
.comment-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 20px;
    display: flex;
    border: 2px solid #e9ecef;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.comment-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff9800, #ffc107, #4caf50);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.comment-item:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: #ff9800;
}

.comment-item:hover::before {
    opacity: 1;
}

.comment-item.dark {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    border-color: #495057;
}

.comment-item.dark:hover {
    border-color: #ffc107;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.comment-item.dark:hover {
    box-shadow: 0 2px 8px rgba(255,255,255,0.1);
}

/* Avatar - Copy từ rating-system.css (dòng 775-797) */
.comment-avatar {
    margin-right: 16px;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.comment-item:hover .comment-avatar img {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.comment-item.dark .comment-avatar img {
    border-color: #495057;
}

/* Content - Copy từ rating-system.css (dòng 799-802) */
.comment-content {
    flex: 1;
    min-width: 0; /* Prevent flex item overflow */
}

/* Header - Copy từ rating-system.css (dòng 804-823) */
.comment-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comment-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

/* Author - Copy từ rating-system.css (dòng 825-835) */
.comment-author {
    color: #2c3e50;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.comment-item.dark .comment-author {
    color: #ecf0f1;
}

/* Time - Copy từ rating-system.css (dòng 848-857) */
.comment-time {
    color: #6c757d;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.comment-item.dark .comment-time {
    color: #adb5bd;
}

/* Text - Copy từ rating-system.css (dòng 870-881) */
.comment-text {
    color: #495057;
    line-height: 1.7;
    margin-top: 12px;
    font-size: 15px;
    word-wrap: break-word;
    hyphens: auto;
}

.comment-item.dark .comment-text {
    color: #dee2e6;
}

/* No Comments */
.no-comments {
    text-align: center;
    padding: 60px 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 24px;
    margin: 30px 0;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

/* Load More Trigger */
#load-more-trigger {
    text-align: center;
    padding: 10px;
}

/* Skeleton Loading */
.comment-skeleton {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.skeleton-line {
    border-radius: 4px;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    transform: translateX(400px);
    transition: transform 0.3s ease-out;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification.toast-success {
    border-left: 4px solid #4CAF50;
}

.toast-notification.toast-success i {
    color: #4CAF50;
}

.toast-notification.toast-error {
    border-left: 4px solid #f44336;
}

.toast-notification.toast-error i {
    color: #f44336;
}

/* Slide In Animation */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Required */
.login-required {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

.login-required.dark {
    background: #3a3a2a;
    border-color: #ffc107;
}

.login-required .google-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: white;
    color: #444;
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    margin-top: 10px;
}

.login-required .google-login-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.login-required .google-login-btn img {
    width: 20px;
    height: 20px;
}

/* Disabled Comments */
.comments-disabled {
    background: #f8d7da;
    border: 1px solid #f44336;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    color: #721c24;
}

.comments-disabled.dark {
    background: #3a2a2a;
    color: #f8d7da;
}

/* IP Banned */
.ip-banned {
    background: #f8d7da;
    border: 1px solid #f44336;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    color: #721c24;
}

.ip-banned.dark {
    background: #3a2a2a;
    color: #f8d7da;
}

/* ===== RESPONSIVE - Copy từ rating-system.css (dòng 1163-1307) ===== */
@media (max-width: 768px) {
    #comment-system-container {
        margin: 15px 0;
    }

    .comment-form {
        padding: 15px;
    }

    .comment-header h3 {
        font-size: 1.25rem;
    }

    /* Comment Header Responsive - Copy từ rating-system.css (dòng 1241-1264) */
    .comment-header {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: left;
    }

    .comment-header-right {
        align-items: flex-start;
    }

    .comment-avatar img {
        width: 44px;
        height: 44px;
    }

    .comment-time {
        margin-left: 0;
    }

    .comment-item {
        padding: 20px;
        margin-bottom: 16px;
        border-radius: 12px;
    }

    .toast-notification {
        right: 10px;
        left: 10px;
        top: 10px;
    }
}

/* Utility Classes */
.d-flex {
    display: flex;
}

.flex-grow-1 {
    flex-grow: 1;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.align-items-start {
    align-items: flex-start;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mr-3 {
    margin-right: 1rem;
}

.p-3 {
    padding: 1rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.rounded {
    border-radius: 0.25rem;
}

.rounded-circle {
    border-radius: 50%;
}

.bg-light {
    background-color: #f8f9fa;
}

.bg-dark {
    background-color: #343a40;
}

.text-white {
    color: #fff;
}

.text-dark {
    color: #212529;
}

/* WebView Warning Styles */
.webview-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
}

.webview-warning.dark {
    background: #2d2d2d;
    border-color: #555;
    color: #ffc107;
}

.webview-warning h4 {
    margin: 0 0 10px 0;
    color: #856404;
}

.webview-warning.dark h4 {
    color: #ffc107;
}

.webview-warning .btn {
    background: #007bff;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    margin: 5px;
    display: inline-block;
}

.webview-warning .btn:hover {
    background: #0056b3;
}

/* Mobile responsive cho WebView warning */
@media (max-width: 768px) {
    .webview-warning {
        padding: 12px;
        font-size: 14px;
    }

    .webview-warning .btn {
        display: block;
        width: 100%;
        margin: 8px 0;
        padding: 12px;
    }
}

