:root {
    --primary-color: #2ecc71;
    --dark-green: #27ae60;
    --light-green: #a5df89;
    --glass-light: rgba(255, 255, 255, 0.7);
    --glass-dark: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.2);
}

/* Class chung */
.glass-effect {
    position: relative;
    background: linear-gradient(135deg, var(--glass-light), var(--glass-dark));
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Hiệu ứng blur (chỉ áp dụng khi trình duyệt hỗ trợ) */
@supports (backdrop-filter: blur(20px)) {
    .glass-effect {
        background: rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
}

/* Hiệu ứng ánh sáng */
.glass-effect::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0) 50%,
        rgba(255, 255, 255, 0.2) 100%
    );
    pointer-events: none;
}

/* === Áp dụng cho các phần cụ thể === */
header,
.comments-section,
.code-runner,
.youtube-player,
footer {
    /* Xóa background-color cũ */
    background-color: white;
    /* Thêm class glass-effect */
    @extend .glass-effect; /* Nếu dùng SASS/SCSS */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    position: relative;
    overflow-x: hidden;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffd9cc;
    z-index: -1;
    filter: brightness(1.0);
}

header {
    background-color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

header h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1rem;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

.container h2 {
    text-align: center;
    color: white;
    margin-bottom: 20px;
}

/* =============== HAMBURGER MENU =============== */
.hamburger-menu {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 1001;
}

.hamburger-icon {
    font-size: 2rem;
    cursor: pointer;
    color: var(--primary-color);
    background-color: var(--glass-light);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.hamburger-icon:hover {
    transform: scale(1.1);
    background-color: var(--glass-dark);
}

.menu-items {
    display: none;
    position: absolute;
    right: 0;
    top: 60px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-width: 220px;
    z-index: 1000;
}

.menu-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid #eee;
    font-weight: 500;
    color: #333;
}

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

.menu-item:hover {
    background-color: var(--light-green);
    color: white;
}

/* =============== BACKGROUND SETTINGS MODAL =============== */
/* =============== MODAL FIX FOR MOBILE =============== */
#backgroundSettingsModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Cho scroll mượt trên iOS */
    display: none;
    z-index: 1002;
}

#backgroundSettingsModal .modal-content {
    max-width: 100%;
    width: 100%;
    height: auto;
    min-height: 100vh;
    border-radius: 0;
    padding: 70px 20px 30px; /* Thêm padding top để tránh bị che nút đóng */
    box-sizing: border-box;
    background: linear-gradient(135deg, var(--glass-light), var(--glass-dark));
    border: none;
}

/* Nút đóng cố định trên cùng */
.close-modal {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    z-index: 1003;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Content scrolling */
.modal-scrollable {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* Input fields mobile fix */
#backgroundSettingsModal input[type="text"],
#backgroundSettingsModal input[type="file"] {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    margin-bottom: 15px;
}

/* Buttons mobile fix */
#backgroundSettingsModal .setting-btn {
    padding: 15px;
    font-size: 1.1rem;
}

/* Preset images grid mobile */
.preset-images {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.preset-images img {
    height: 70px;
}

/* Toggle switch mobile */
.toggle-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.switch {
    align-self: flex-end;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    #backgroundSettingsModal {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(0, 0, 0, 0.7);
    }
    
    #backgroundSettingsModal .modal-content {
        max-width: 500px;
        height: auto;
        min-height: auto;
        border-radius: 10px;
        padding: 30px;
    }
    
    .close-modal {
        position: absolute;
        top: 15px;
        right: 15px;
        background: none;
        color: #888;
        box-shadow: none;
    }
    
    .preset-images {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .toggle-container {
        flex-direction: row;
        align-items: center;
    }
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Preset Images */
.preset-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.preset-images img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.preset-images img:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.preset-images img.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

/* Setting Buttons */
.setting-btn {
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 1rem;
    margin-top: 10px;
}

.setting-btn:hover {
    background-color: var(--dark-green);
    transform: translateY(-2px);
}

.file-requirements {
    font-size: 0.8rem;
    color: #666;
    margin: 5px 0;
}

/* =============== RESPONSIVE ADJUSTMENTS =============== */
@media (max-width: 768px) {
    .hamburger-menu {
        top: 20px;
        right: 20px;
    }
    
    .hamburger-icon {
        width: 45px;
        height: 45px;
        font-size: 1.8rem;
    }
    
    .menu-items {
        top: 55px;
        min-width: 200px;
    }
    
    .preset-images {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hamburger-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .menu-item {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* =============== PHẦN CÒN LẠI GIỮ NGUYÊN NHƯ FILE CSS CỦA BẠN =============== */
/* Thông báo truy cập */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.notification-box {
    background-color: white;
    border-radius: 15px;
    padding: 20px;
    width: 90%;
    max-width: 350px;
    text-align: center;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
    color: #888;
    transition: color 0.3s;
    background: none;
    border: none;
}

.close-btn:hover {
    color: #e74c3c;
}

.avatar-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    border: 2px solid white;
}

.rainbow-border {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(
        #ff0000, #ff7f00, #ffff00, #00ff00, 
        #0000ff, #4b0082, #9400d3, #ff0000
    );
    animation: spin 2s linear infinite;
    z-index: 1;
}

.rainbow-border::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    background: white;
    border-radius: 50%;
    z-index: 1;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.owner-name {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.website-desc {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.update-time {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    color: black;
    margin-bottom: 5px;
}

.update-date {
    color: #888;
    font-size: 0.9rem;
}

/* Các môn học */
.subjects-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.subject-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    aspect-ratio: 16/9;
    position: relative;
}

.subject-card:hover {
    transform: translateY(-5px);
}

.subject-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
    border-radius: 8px;
}

.subject-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
    padding: 15px;
}

.subject-title {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.subject-lessons {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Tạo viền xanh nổi bật */
.subject-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid #2ecc71;
    border-radius: 10px;
    pointer-events: none;
    z-index: 2;
}

/* Fullscreen styles */
.output-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 1000;
    padding: 20px;
    overflow: auto;
}

.fullscreen-iframe {
    width: 100%;
    height: calc(100% - 50px);
    border: none;
}

.fullscreen-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
}

.fullscreen-btn {
    padding: 10px 15px;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
}

.fullscreen-btn:hover {
    background-color: #2980b9;
}

.close-fullscreen {
    background-color: #e74c3c;
}

.close-fullscreen:hover {
    background-color: #c0392b;
}

.subjects-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.subject-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    aspect-ratio: 16/9;
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.subject-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.subject-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 20px;
}

.subject-title {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.subject-lessons {
    font-size: 0.9rem;
    opacity: 0.8;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.modal-message {
    font-size: 1.1rem;
    margin-bottom: 25px;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-yes {
    background-color: var(--primary-color);
    color: white;
}

.btn-yes:hover {
    background-color: var(--dark-green);
}

.btn-guide {
    background-color: #2980b9;
    color: white;
}

.btn-guide:hover {
    background-color: black;
}

.btn-no {
    background-color: #e74c3c;
    color: white;
}

.btn-no:hover {
    background-color: #c0392b;
}

.guide-content {
    text-align: left;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #2ecc71;
}

.toggle-heart {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.toggle-heart:hover {
    transform: scale(1.1);
}

.heart {
    position: absolute;
    font-size: 2rem;
    animation: heartFloat 3s ease-in forwards;
    pointer-events: none;
    z-index: 5;
}

@keyframes heartFloat {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

.comments-section {
    margin-top: 50px;
    padding: 30px;
    background-color: transparent;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 1);
}

.comments-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    text-shadow: 
        -1px -1px 0 #000,  
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: bold;
}

.form-group input, .form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.submit-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: var(--dark-green);
}

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

.comment {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    border-left: 3px solid var(--primary-color);
    position: relative;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: bold;
}

.comment-content {
    line-height: 1.6;
}

.admin-comment .comment-header span:first-child {
    color: var(--primary-color);
    font-weight: bold;
}

.admin-comment .comment-content {
    color: #e74c3c;
    font-weight: bold;
}

.delete-comment-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 0.8rem;
}

footer {
    text-align: center;
    padding: 20px;
    background-color: white;
    margin-top: 50px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Swipe indicator */
.swipe-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.subject-card:hover .swipe-indicator {
    opacity: 1;
}

/* Code Runner Section */
.code-runner {
    margin-top: 50px;
    padding: 30px;
    background-color: transparent;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 1);
}

.code-runner-title {
    font-size: 1.8rem;
    color: #2ecc71;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    text-shadow: 
        -1px -1px 0 #000,  
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000;
}

.code-runner-options {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
}

.code-runner-option {
    padding: 10px 20px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.code-runner-option.active {
    background-color: #2ecc71;
    color: white;
}

.code-editor {
    width: 100%;
    height: 300px;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    font-family: monospace;
    font-size: 1rem;
    margin-bottom: 15px;
    resize: vertical;
}

.file-upload {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.upload-btn {
    padding: 10px 15px;
    background-color: #2980b9;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.upload-btn:hover {
    background-color: #2980b9;
}

.run-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 25px;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

.run-btn:hover {
    background-color: #27ae60;
}

.run-btn::before {
    content: "▶";
    font-size: 0.8rem;
}

.output-container {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    min-height: 100px;
    white-space: pre-wrap;
    font-family: monospace;
}

.error-message {
    color: #e74c3c;
    font-weight: bold;
}

iframe {
    width: 100%;
    height: 300px;
    border: none;
    border-radius: 5px;
}

/* YouTube Player Section */
.youtube-player {
    margin-top: 50px;
    padding: 30px;
    background-color: transparent;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 1);
}

.youtube-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    text-shadow: 
        -1px -1px 0 #000,  
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000;
}

.youtube-tabs {
    display: flex;
    margin-bottom: 15px;
    justify-content: center;
    gap: 5px;
}

.youtube-tab {
    padding: 8px 15px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.youtube-tab.active {
    background-color: var(--primary-color);
    color: white;
}

.search-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-input-container input {
    flex: 1;
}

.youtube-channel-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.youtube-channel-item:hover {
    background-color: #eee;
}

.youtube-channel-item img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.youtube-channel-info {
    flex: 1;
}

.youtube-channel-info h4 {
    margin: 0;
    color: #333;
}

.youtube-channel-info p {
    margin: 5px 0 0;
    color: #666;
    font-size: 0.8rem;
}

.youtube-video-player {
    width: 100%;
    height: 500px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
}

.youtube-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.youtube-video-item {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.youtube-video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.youtube-video-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.youtube-video-item .title {
    padding: 10px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.youtube-video-item .channel {
    padding: 0 10px 10px;
    font-size: 12px;
    color: #666;
}

/* View more/less buttons */
.view-more-less {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.view-more-btn, .view-less-btn {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.view-more-btn:hover, .view-less-btn:hover {
    background-color: var(--dark-green);
}

.view-less-btn {
    background-color: #e74c3c;
}

.view-less-btn:hover {
    background-color: #c0392b;
}

/* Pagination */
.youtube-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.pagination-btn {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.pagination-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Hidden class for comments and videos */
.hidden {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .subjects-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .modal-buttons {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
    }

    .youtube-video-player {
        height: 300px;
    }

    /* Thêm phần fix cho thanh tìm kiếm */
    .search-input-container {
        flex-direction: column;
    }

    .search-input-container input {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .search-input-container button {
        width: 100%;
    }

    .youtube-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .youtube-tab {
        margin-right: 5px;
        flex: 0 0 auto;
    }

    /* Đảm bảo các tab không bị wrap */
    .youtube-tabs::-webkit-scrollbar {
        display: none;
    }

    .youtube-download-btn {
        position: absolute;
        bottom: 10px;
        right: 10px;
        background-color: #e74c3c;
        color: white;
        border: none;
        border-radius: 5px;
        padding: 5px 10px;
        font-size: 12px;
        cursor: pointer;
        z-index: 2;
        transition: all 0.2s;
    }
    .youtube-download-btn:hover {
        background-color: #c0392b;
    }
    .youtube-video-item {
        position: relative;
    }
}
/* =============== MOBILE MODAL FIX =============== */
@media (max-width: 767px) {
    #backgroundSettingsModal {
        align-items: flex-start;
        padding-top: 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #backgroundSettingsModal .modal-content {
        width: 95%;
        max-width: 100%;
        margin: 20px auto;
        max-height: 90vh;
        overflow-y: auto;
        position: relative;
    }
    
    .close-modal {
        position: fixed;
        top: 15px;
        right: 15px;
        background-color: #e74c3c;
        color: white;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1003;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    
    /* Fix content scrolling */
    #backgroundSettingsModal .setting-option {
        padding-bottom: 15px;
        margin-bottom: 15px;
    }
    
    /* Larger touch targets */
    #backgroundSettingsModal .setting-btn,
    #backgroundSettingsModal .switch {
        transform: scale(1.05);
    }
    
    /* Adjust preset images */
    .preset-images {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop styles remain unchanged */
@media (min-width: 768px) {
    #backgroundSettingsModal {
        align-items: center;
    }
    
    #backgroundSettingsModal .modal-content {
        max-width: 500px;
        max-height: 80vh;
    }
    
    .close-modal {
        position: absolute;
        background: none;
        color: #888;
        width: auto;
        height: auto;
        box-shadow: none;
    }
}
/* Nút đóng modal to hơn */
.close-modal {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    z-index: 1003;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-modal:hover {
    transform: scale(1.1);
    background-color: #c0392b;
}

/* Modal content */
.modal-content {
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(245,245,245,0.9));
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow-y: auto;
    max-height: 90vh;
}

/* Preset images grid */
.preset-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin: 15px 0;
}

.preset-images img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.preset-images img:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.preset-images img.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.6);
    transform: scale(1.03);
}

/* Setting buttons */
.setting-btn {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 1rem;
    margin: 10px 0;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.setting-btn:hover {
    background-color: var(--dark-green);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .preset-images {
        grid-template-columns: repeat(3, 1fr));
    }
    
    .close-modal {
        width: 45px;
        height: 45px;
        font-size: 25px;
    }
}

@media (max-width: 480px) {
    .preset-images {
        grid-template-columns: repeat(2, 1fr));
        gap: 8px;
    }
    
    .preset-images img {
        height: 70px;
    }
    
    .close-modal {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}
.comment {
    font-size: 12px;  // Giảm từ 16px xuống 12px
    line-height: 1.4;
}

.comment-content {
    word-wrap: break-word;
    max-width: 100%;
}

.admin-comment {
    border-left: 3px solid #e74c3c;
    padding-left: 10px;
}
/* Thêm vào file CSS */

#adminLoginBtn, #adminLogoutBtn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

#adminLoginBtn:hover, #adminLogoutBtn:hover {
    background: #c0392b;
}

#adminLogoutBtn {
    display: none;
    background: #3498db;
}

#adminLogoutBtn:hover {
    background: #2980b9;
}

.admin-comment {
    border-left: 3px solid #e74c3c;
    position: relative;
}
#adminLoginBtn, #adminLogoutBtn {
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

#adminLoginBtn {
    background: #e74c3c;
    color: white;
    display: block !important;
}

#adminLoginBtn:hover {
    background: #c0392b;
}

#adminLogoutBtn {
    background: #3498db;
    color: white;
}

#adminLogoutBtn:hover {
    background: #2980b9;
}
.delete-comment-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e74c3c;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

.comment:hover .delete-comment-btn {
    opacity: 1;
}
/* Xóa các style cũ của adminPanel */
/* Phần admin panel */
#adminPanel {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    width: 100%;
}

/* Nút đăng nhập admin */
#adminLoginBtn, #adminLogoutBtn {
    margin: 0 auto; /* Căn giữa theo chiều ngang */
    display: block; /* Chuyển thành block để margin auto hoạt động */
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
}

/* Google button style */
.google-btn {
    background: #4285F4;
    color: white;
    border: none;
}

.google-btn:hover {
    background: #3367D6;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Logout button style */
.logout-btn {
    background: #EA4335;
    color: white;
    border: none;
}

.logout-btn:hover {
    background: #D33426;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}