/* style.css - Premium styling for AhoVideoKW frontend application (AhoShadowing) */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

.ahovideokw-app {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f172a; /* Slate 900 */
    color: #f8fafc; /* Slate 50 */
    padding: 30px;
    border-radius: 16px;
    max-width: 1000px;
    margin: 30px auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ahovideokw-app * {
    box-sizing: border-box;
}

/* HEADER STYLE */
.ahovideokw-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ahovideokw-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    background: linear-gradient(135deg, #f472b6 0%, #6366f1 100%); /* Pink to Violet */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.ahovideokw-header p {
    font-size: 16px;
    color: #94a3b8; /* Slate 400 */
    margin: 0;
}

/* BACK BUTTONS */
.ahovideokw-btn-back {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-bottom: 25px;
}

.ahovideokw-btn-back:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-3px);
}

/* VIEW 1: PLAYLISTS GRID */
.ahovideokw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.ahovideokw-playlist-card {
    background: rgba(30, 41, 59, 0.7); /* Slate 800 with transparency */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.ahovideokw-playlist-card:hover {
    transform: translateY(-8px);
    border-color: rgba(99, 102, 241, 0.4); /* Violet glow */
    box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(99, 102, 241, 0.2);
}

.ahovideokw-playlist-cover {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.ahovideokw-playlist-cover::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0) 50%, rgba(15, 23, 42, 0.8) 100%);
}

.ahovideokw-playlist-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(99, 102, 241, 0.9); /* Indigo 500 */
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.ahovideokw-playlist-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ahovideokw-playlist-info h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: #f1f5f9;
}

/* PLAYLIST MINI PROGRESS BAR */
.ahovideokw-playlist-card .progress-section {
    margin-top: auto;
}

.ahovideokw-playlist-card .progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.ahovideokw-playlist-card .progress-bar-bg {
    width: 100%;
    height: 6px;
    background: #1e293b;
    border-radius: 10px;
    overflow: hidden;
}

.ahovideokw-playlist-card .progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ec4899 0%, #6366f1 100%);
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* VIEW 2: PLAYLIST DETAIL */
.ahovideokw-playlist-title-display {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #f1f5f9;
    border-left: 4px solid #ec4899;
    padding-left: 12px;
}

/* DETAILED PROGRESS BAR */
.ahovideokw-progress-section {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.ahovideokw-progress-section .progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 10px;
    align-items: center;
}

.ahovideokw-progress-section .progress-label {
    font-weight: 500;
    color: #cbd5e1;
}

.ahovideokw-progress-section .progress-stats {
    font-weight: 600;
    color: #f472b6;
}

.ahovideokw-progress-section .progress-bar-container {
    width: 100%;
    height: 10px;
    background: #0f172a;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.ahovideokw-progress-section .progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f472b6 0%, #6366f1 100%);
    border-radius: 10px;
    transition: width 0.5s ease-out;
}

.ahovideokw-progress-section .progress-toggle-area {
    display: flex;
    justify-content: flex-end;
}

.toggle-completed-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #94a3b8;
    cursor: pointer;
    user-select: none;
}

.toggle-completed-label input {
    cursor: pointer;
    accent-color: #ec4899;
}

/* VIDEOS LIST GRID */
.ahovideokw-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.ahovideokw-video-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.ahovideokw-video-card:hover {
    transform: scale(1.02);
    border-color: rgba(244, 114, 182, 0.3);
}

.ahovideokw-video-thumb-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect */
    background: #000;
}

.ahovideokw-video-thumb {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
}

.ahovideokw-video-duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.85);
    color: #e2e8f0;
    font-size: 10px;
    font-weight: 500;
    padding: 3px 6px;
    border-radius: 4px;
}

.ahovideokw-video-status-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ahovideokw-video-status-badge.status-completed {
    background: #10b981; /* Emerald 500 */
}

.ahovideokw-video-status-badge.status-learning {
    background: #f59e0b; /* Amber 500 */
}

.ahovideokw-video-card-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.ahovideokw-video-card-info h5 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: #e2e8f0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 40px;
}

.ahovideokw-btn-practice {
    background: linear-gradient(135deg, #ec4899 0%, #6366f1 100%);
    color: #fff;
    border: none;
    padding: 8px 0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    width: 100%;
    text-align: center;
    transition: all 0.2s;
}

.ahovideokw-btn-practice:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* VIEW 3: PRACTICE ROOM */
.ahovideokw-video-title-display {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 25px 0;
    color: #f1f5f9;
    text-align: center;
}

.ahovideokw-player-container {
    display: block;
    max-width: 800px;
    margin: 0 auto;
}

/* PLAYER PANEL - CENTERED */
.ahovideokw-player-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.ahovideokw-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ahovideokw-video-wrapper iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

/* FRONTEND TOOLBAR */
/* FRONTEND TOOLBAR WITH GLASSMORPHISM */
.wsp-toolbar {
    background: rgba(15, 23, 42, 0.75); /* Translucent dark slate */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 18px;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.wsp-toolbar-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wsp-toolbar-btn {
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wsp-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Nút Play/Pause nổi bật với Gradient Indigo */
.wsp-toolbar-btn.btn-play {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 18px;
    font-size: 14px;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.wsp-toolbar-btn.btn-play:hover {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5);
    transform: translateY(-1.5px);
}

.wsp-toolbar-btn.active {
    background: linear-gradient(135deg, #db2777 0%, #7c3aed 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 14px rgba(219, 39, 119, 0.4);
}

.btn-no-ads-premium {
    background: linear-gradient(135deg, #fb7185 0%, #e11d48 100%); /* Rich premium rose gradient */
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 10px 24px;
    border-radius: 20px; /* Modern pillow shape */
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(225, 29, 72, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn-no-ads-premium:hover {
    background: linear-gradient(135deg, #fda4af 0%, #f43f5e 100%);
    box-shadow: 0 6px 20px rgba(225, 29, 72, 0.5);
    transform: translateY(-2px) scale(1.03);
}

.btn-no-ads-premium:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.4);
}

.wsp-toolbar-btn.step-1 {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(251, 191, 36, 0.3) !important;
}

.wsp-toolbar-btn.step-2 {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35) !important;
    animation: wsp-pulse 1.2s infinite alternate;
}

@keyframes wsp-pulse {
    from { opacity: 0.85; transform: scale(1); }
    to { opacity: 1; transform: scale(1.04); }
}

.wsp-time-display {
    font-family: 'Outfit', monospace;
    font-size: 13px;
    color: #94a3b8;
    margin-left: 5px;
    font-weight: 500;
}

.wsp-range-badge {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* Playback Speed inside Toolbar */
.wsp-toolbar .speed-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wsp-toolbar .speed-label {
    font-size: 12px;
    color: #94a3b8;
    margin-right: 4px;
    font-weight: 500;
}

.wsp-toolbar .btn-speed {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    padding: 5px 8px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.wsp-toolbar .btn-speed:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.wsp-toolbar .btn-speed.active {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

/* Complete button */
.complete-button-panel {
    margin-top: 25px;
}

.btn-complete-lesson {
    width: 100%;
    background: #10b981;
    color: #fff;
    border: none;
    padding: 12px 0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-complete-lesson:hover {
    background: #059669;
}

.btn-complete-lesson.completed {
    background: #475569;
    cursor: default;
}

/* SCRIPT MODAL POPUP SYSTEM */
.ahovideokw-script-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.85); /* Dark semi-transparent background */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.25s ease;
    padding: 20px;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ahovideokw-script-modal-content {
    background: #1e293b; /* Slate 800 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 100%;
    max-width: 650px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.ahovideokw-script-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ahovideokw-script-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #f1f5f9;
}

.ahovideokw-script-modal-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.ahovideokw-script-modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #f8fafc;
}

.ahovideokw-script-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.script-body-content {
    line-height: 1.8;
    font-size: 15px;
    color: #e2e8f0;
    margin-bottom: 25px;
    word-wrap: break-word;
}

.script-body-content em.updating-text {
    color: #64748b;
    font-style: italic;
    display: block;
    text-align: center;
    padding: 30px 0;
}

/* SCRIPT FEEDBACK & CONTRIBUTIONS IN POPUP */
.script-contribution-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
    margin-top: auto;
}

.btn-toggle-contrib {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    width: 100%;
    padding: 8px 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-toggle-contrib:hover {
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.02);
}

.contrib-form-wrapper {
    margin-top: 15px;
}

.ahovideokw-contrib-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 10px 0;
}

.script-contribution-section .form-desc {
    font-size: 13px;
    color: #94a3b8;
    margin: 0 0 4px 0;
    line-height: 1.5;
}

.ahovideokw-contrib-form textarea {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #f8fafc;
    padding: 14px 16px;
    font-size: 14px;
    outline: none;
    height: 150px;
    resize: vertical;
    width: 100%;
    transition: all 0.25s ease;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ahovideokw-contrib-form textarea:focus {
    border-color: #6366f1;
    background: rgba(15, 23, 42, 0.85);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.25), inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-submit-contrib {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-submit-contrib:hover {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.contrib-status-msg {
    font-size: 12px;
    margin-top: 5px;
    text-align: center;
}

/* RESPONSIVE DESIGN */
@media (max-width: 992px) {
    .ahovideokw-player-container {
        padding: 0 10px;
    }
}

@media (max-width: 768px) {
    .wsp-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .wsp-toolbar-group {
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
    }
    
    .wsp-toolbar .speed-group {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .ahovideokw-app {
        padding: 15px;
    }

    .ahovideokw-header h2 {
        font-size: 24px;
    }

    .ahovideokw-script-modal-content {
        max-height: 90vh;
        border-radius: 12px;
    }
    
    .ahovideokw-script-modal-body {
        padding: 15px;
    }
}

/* ==========================================================================
   NEW FEATURES STYLING (FAVORITES, HIDE, RATINGS, AUTH)
   ========================================================================== */

/* Header buttons layout */
.header-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 5px;
}

.header-action-buttons {
    display: flex;
    gap: 10px;
}

.header-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: #fff;
    transform: translateY(-1px);
}

/* Playlist Card Actions & Overlays */
.ahovideokw-playlist-cover {
    position: relative;
}

.playlist-card-actions {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 8px;
    z-index: 5;
}

.btn-favorite-playlist, .btn-hide-playlist, .btn-hide-video {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

/* Highly visible favorite icon button */
.btn-favorite-playlist {
    background: rgba(244, 114, 182, 0.25);
    border: 1.5px solid rgba(244, 114, 182, 0.6);
    color: #fff;
}

.btn-favorite-playlist:hover {
    transform: scale(1.15);
    background: rgba(244, 114, 182, 0.95);
    border-color: #f472b6;
    box-shadow: 0 0 12px rgba(244, 114, 182, 0.7);
}

.btn-favorite-playlist.active {
    background: rgba(244, 114, 182, 0.95);
    border-color: #f472b6;
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 12px rgba(244, 114, 182, 0.7);
}

/* Highly visible hide playlist button */
.btn-hide-playlist {
    background: rgba(239, 68, 68, 0.25);
    border: 1.5px solid rgba(239, 68, 68, 0.6);
    color: #fff;
}

.btn-hide-playlist:hover {
    background: rgba(239, 68, 68, 0.95);
    border-color: #ef4444;
    color: #fff;
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
}

/* Highly visible hide video button - always visible on video thumbnail */
.ahovideokw-video-thumb-container .btn-hide-video {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    font-size: 12px;
    z-index: 5;
    opacity: 0.85;
    background: rgba(239, 68, 68, 0.35);
    border: 1.5px solid rgba(239, 68, 68, 0.75);
    color: #fff;
    transition: all 0.2s ease;
}

.ahovideokw-video-card:hover .btn-hide-video {
    opacity: 1;
    transform: scale(1.1);
    background: rgba(239, 68, 68, 0.95);
    border-color: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.7);
}

/* Fix overlap of favorite and hide buttons inside video cards */
.video-card-actions .btn-favorite-video,
.video-card-actions .btn-hide-video {
    position: static !important;
    margin: 0 !important;
    transform: none !important;
    opacity: 1 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3) !important;
}

.video-card-actions .btn-favorite-video:hover,
.video-card-actions .btn-hide-video:hover {
    transform: scale(1.15) !important;
}

/* Video Card Ratings & Bottom elements */
.video-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    gap: 10px;
}

.video-grid-rating {
    font-size: 12px;
    color: #facc15; 
    background: rgba(250, 204, 21, 0.08);
    border: 1px solid rgba(250, 204, 21, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-grid-rating.no-ratings {
    color: #64748b;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

/* Playlist Grid Rating */
.playlist-grid-rating {
    font-size: 12px;
    color: #facc15; 
    background: rgba(250, 204, 21, 0.08);
    border: 1px solid rgba(250, 204, 21, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    width: fit-content;
}

.playlist-grid-rating.no-ratings {
    color: #64748b;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.video-card-bottom .ahovideokw-btn-practice {
    width: auto;
    padding: 6px 14px;
    flex-shrink: 0;
}

/* Practice Room Rating Section */
.video-rating-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    flex-wrap: wrap;
}

.video-rating-section > span {
    font-size: 14px;
    color: #cbd5e1;
    font-weight: 500;
}

.rating-stars {
    display: flex;
    gap: 4px;
    font-size: 24px;
    cursor: pointer;
    user-select: none;
}

.star-item {
    color: #475569;
    transition: transform 0.15s ease, color 0.15s ease;
}

.star-item:hover {
    transform: scale(1.25);
}

.star-item.active {
    color: #facc15;
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
}

.rating-stats-text {
    font-size: 13px;
    color: #94a3b8;
}

/* Modal System Styles */
.ahovideokw-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.2s ease;
}

.ahovideokw-modal-overlay .ahovideokw-modal-content {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 40px rgba(99, 102, 241, 0.1);
    animation: modalSlideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ahovideokw-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.no-data-modal {
    text-align: center;
    color: #64748b;
    font-style: italic;
    padding: 30px 0;
    font-size: 14px;
    line-height: 1.6;
}

/* Modal List items (favorites/hidden lists) */
.modal-list-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    gap: 15px;
    transition: background 0.2s ease;
    border-radius: 8px;
}

.modal-list-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

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

.modal-list-item .item-img {
    width: 50px;
    height: 50px;
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-list-item .item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.modal-list-item .item-title-link {
    color: #f1f5f9;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s ease;
}

.modal-list-item .item-title-link:hover {
    color: #f472b6;
}

.modal-list-item .item-title {
    color: #cbd5e1;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
}

.modal-list-item .item-meta {
    font-size: 11px;
    color: #64748b;
}

.btn-remove-favorite-modal {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.15s, transform 0.15s;
}

.btn-remove-favorite-modal:hover {
    opacity: 1;
    transform: scale(1.15);
}

.btn-unhide-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-unhide-item:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #10b981;
}

.hidden-modal-section {
    margin-bottom: 20px;
}

.hidden-modal-section h4 {
    margin: 0 0 10px 0;
    font-size: 12px;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Quick Auth Modal specific */
.auth-modal-content {
    max-width: 400px !important;
}

.auth-notice {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0 0 20px 0;
    text-align: center;
}

.auth-tabs {
    display: flex;
    background: #0f172a;
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #64748b;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.auth-tab-btn.active {
    background: #1e293b;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.auth-form-login, .auth-form-register {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-form-login input, .auth-form-register input {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #f8fafc;
    padding: 10px 14px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

.auth-form-login input:focus, .auth-form-register input:focus {
    border-color: #6366f1;
}

.btn-auth-submit {
    background: linear-gradient(135deg, #ec4899 0%, #6366f1 100%);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    margin-top: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.btn-auth-submit:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

.btn-auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-status-msg {
    margin-top: 15px;
    font-size: 12px;
    text-align: center;
    line-height: 1.4;
    min-height: 18px;
}

/* Animations and Responsive overrides */
@media (max-width: 480px) {
    .header-main-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .playlist-card-actions {
        top: 8px;
        left: 8px;
    }
    
    .btn-favorite-playlist, .btn-hide-playlist {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* ==========================================================================
   ADDED CUSTOM SHADOWING & DIALOG DESIGNS (AhoVideoKW Showcase V2)
   ========================================================================== */

/* Playback Speed dropdown selector styling */
.wsp-speed-dropdown {
    position: relative;
    display: inline-block;
    width: auto;
}

.wsp-speed-dropdown-btn {
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    user-select: none;
}

.wsp-speed-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.wsp-speed-dropdown-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a; /* Slate 900 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 6px 0;
    min-width: 120px;
    z-index: 1000;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
    margin-bottom: 10px;
    animation: speedFadeInUp 0.15s ease-out;
}

@keyframes speedFadeInUp {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.wsp-speed-dropdown-content .speed-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    color: #cbd5e1;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    user-select: none;
}

.wsp-speed-dropdown-content .speed-option:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #fff;
}

.wsp-speed-dropdown-content .speed-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    outline: none;
    margin: 0 0 0 10px;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.wsp-speed-dropdown-content .speed-option input[type="radio"]:checked {
    border-color: #6366f1;
    background: #6366f1;
}

.wsp-speed-dropdown-content .speed-option input[type="radio"]:checked::after {
    content: '✓';
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    display: block;
}

/* Script Modal tab design */
.script-modal-tabs {
    display: flex;
    background: #0f172a;
    padding: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    gap: 4px;
}

.script-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #64748b;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    border-radius: 4px;
}

.script-tab-btn:hover {
    color: #cbd5e1;
}

.script-tab-btn.active {
    color: #f8fafc;
    background: #1e293b;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Click seek script lines (Shadowing xịn) */
.script-line {
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    color: #e2e8f0;
    line-height: 1.6;
}

.script-line:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    transform: translateX(3px);
}

.script-line.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
    font-weight: 600;
    border-left: 4px solid #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

/* Tăng kích thước và z-index nút đóng modal trên điện thoại */
.ahovideokw-script-modal-close,
.ahovideokw-modal-close-favorites,
.ahovideokw-modal-close-hidden,
.ahovideokw-modal-close-hidden-videos,
.ahovideokw-modal-close-confirm,
.ahovideokw-modal-close-auth {
    width: 36px !important;
    height: 36px !important;
    font-size: 18px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    z-index: 10005 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 50% !important;
    border: none !important;
    color: #94a3b8 !important;
    transition: all 0.2s !important;
}

.ahovideokw-script-modal-close:hover,
.ahovideokw-modal-close-favorites:hover,
.ahovideokw-modal-close-hidden:hover,
.ahovideokw-modal-close-hidden-videos:hover,
.ahovideokw-modal-close-confirm:hover,
.ahovideokw-modal-close-auth:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #f8fafc !important;
}

/* Thêm nút Yêu thích bài học trên Thumbnail card */
.btn-favorite-video {
    background: rgba(244, 114, 182, 0.25);
    border: 1.5px solid rgba(244, 114, 182, 0.6);
    color: #fff;
}

.btn-favorite-video:hover {
    transform: scale(1.15);
    background: rgba(244, 114, 182, 0.95);
    border-color: #f472b6;
    box-shadow: 0 0 12px rgba(244, 114, 182, 0.7);
}

.btn-favorite-video.active {
    background: rgba(244, 114, 182, 0.95);
    border-color: #f472b6;
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 12px rgba(244, 114, 182, 0.7);
}

/* Toolbar responsiveness improvements */
@media (max-width: 768px) {
    .wsp-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        padding: 12px !important;
        border-radius: 12px !important;
    }
    
    .wsp-toolbar-group.play-controls {
        display: grid !important;
        grid-template-columns: auto 1fr 1fr auto !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
    }
    
    .wsp-toolbar-group.loop-controls {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
    }
    
    .wsp-toolbar-group.speed-selector-wrapper {
        width: 100% !important;
        justify-content: center !important;
    }
    
    .wsp-speed-dropdown {
        width: 100% !important;
    }
    
    .wsp-speed-dropdown-btn {
        width: 100% !important;
        padding: 10px 0 !important;
        text-align: center !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px !important;
    }
    
    .wsp-speed-dropdown-content {
        width: 100% !important;
        bottom: 100% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    
    .wsp-toolbar-btn {
        padding: 10px 8px !important;
        font-size: 12px !important;
        justify-content: center !important;
        width: 100% !important;
        border-radius: 8px !important;
    }
    
    .wsp-time-display {
        text-align: right !important;
        font-size: 11px !important;
        margin-left: 0 !important;
        white-space: nowrap;
    }
}

/* PAGINATION BUTTONS */
.ahovideokw-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 25px 0 10px 0;
    align-items: center;
}

.pagination-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: #fff;
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

@media (max-width: 600px) {
    .ahovideokw-pagination {
        gap: 6px;
        margin: 20px 0 10px 0;
    }
    .pagination-btn {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
        padding: 0 6px;
        border-radius: 6px;
    }
}