.youtube-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 0.5rem;
}

.youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.score-highlight {
    animation: pulse 0.4s ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Custom button styles - giữ màu như ban đầu */
/* Prevent flash by applying styles immediately */
.btn-primary {
    background-color: #3b82f6 !important;
    color: white !important;
    border: none !important;
}

/* Ensure buttons have correct color on initial render */
#load-video-btn.btn-primary {
    background-color: #3b82f6 !important;
    color: white !important;
    border: none !important;
}

#fetch-new-videos-btn.btn-secondary {
    background-color: #64748b !important;
    color: white !important;
    border: none !important;
}

.btn-primary:hover {
    background-color: #2563eb !important;
}

.btn-secondary {
    background-color: #64748b !important;
    color: white !important;
    border: none !important;
}

.btn-secondary:hover {
    background-color: #475569 !important;
}

.btn-ghost-custom {
    /* background-color: #f1f5f9 !important; */
    /* color: #334155 !important; */
    border: 1px solid #cbd5e1 !important;
}

.btn-ghost-custom:hover {
    background-color: #e2e8f0 !important;
}

.btn-error-custom {
    background-color: #fef2f2 !important;
    color: #dc2626 !important;
    border: 1px solid #fca5a5 !important;
}

.btn-error-custom:hover {
    background-color: #fee2e2 !important;
}

.btn-adjust {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}

.btn-adjust:hover {
    background-color: #e2e8f0 !important;
}

.btn-warning-custom {
    background-color: #fef3c7 !important;
    color: #d97706 !important;
    border: 1px solid #fcd34d !important;
}

.btn-warning-custom:hover {
    background-color: #fde68a !important;
}

.btn-success {
    background-color: #10b981 !important;
    color: white !important;
    border: none !important;
}

.btn-success:hover {
    background-color: #059669 !important;
}

 .btn-youtube {
    background-color: #ff6363  !important;
    color: white !important;
    border: none !important;
}

.btn-youtube:hover {
    background-color: #bd0000 !important;
}   

/* Layout Switching Styles */
/* Layout 1 column: max-w-5xl, all sections stack vertically */
#main-container.layout-1-column {
    max-width: 56rem !important; /* max-w-5xl */
}

/* Ensure grid container supports ordering */
#main-container.layout-1-column .grid {
    display: grid !important;
}

/* Override responsive classes for 1-column layout - force everything to stack vertically */
#main-container.layout-1-column .layout-video-player {
    grid-column: span 12 / span 12 !important;
    grid-column-start: 1 !important;
    grid-column-end: 13 !important;
    grid-row-start: auto !important;
    order: 1 !important;
}

@media (min-width: 1280px) {
    #main-container.layout-1-column .layout-video-player {
        grid-column: span 12 / span 12 !important;
        grid-column-start: 1 !important;
        grid-column-end: 13 !important;
        grid-row-start: auto !important;
        order: 1 !important;
    }
}

/* Right Column: Force to full width and stack vertically */
#main-container.layout-1-column .layout-right-column {
    grid-column: span 12 / span 12 !important;
    grid-column-start: 1 !important;
    grid-column-end: 13 !important;
    grid-row-start: auto !important;
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
    flex-direction: unset !important;
    order: 2 !important;
}

@media (min-width: 768px) {
    #main-container.layout-1-column .layout-right-column {
        grid-column: span 12 / span 12 !important;
        grid-column-start: 1 !important;
        grid-column-end: 13 !important;
        grid-row-start: auto !important;
        display: grid !important;
        grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
        gap: 0.5rem !important;
        order: 2 !important;
    }
}

@media (min-width: 1280px) {
    #main-container.layout-1-column .layout-right-column {
        grid-column: span 12 / span 12 !important;
        grid-column-start: 1 !important;
        grid-column-end: 13 !important;
        grid-row-start: auto !important;
        display: grid !important;
        grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
        gap: 0.5rem !important;
        flex-direction: unset !important;
        order: 2 !important;
    }
}

/* Video Control: Full width */
#main-container.layout-1-column .layout-video-control {
    grid-column: span 12 !important;
}

@media (min-width: 768px) {
    #main-container.layout-1-column .layout-video-control {
        grid-column: span 12 !important;
    }
}

/* History and Export: Side by side, 6 columns each */
#main-container.layout-1-column .layout-history {
    grid-column: span 6 !important;
}

@media (min-width: 768px) {
    #main-container.layout-1-column .layout-history {
        grid-column: span 6 !important;
    }
}

#main-container.layout-1-column .layout-export {
    grid-column: span 6 !important;
}

@media (min-width: 768px) {
    #main-container.layout-1-column .layout-export {
        grid-column: span 6 !important;
    }
}

/* Layout 2 columns: default (current layout) */
#main-container.layout-2-columns {
    max-width: 90rem !important; /* max-w-8xl */
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Custom DaisyUI rounded box */
:root {
    --rounded-box: 0.8rem;
    --rounded-btn: 0.4rem;
    --padding-card: 0.5rem;
}

@media (max-width: 640px) {
    :root {
        --padding-card: 0.25rem;
    }
}


/* SweetAlert2 custom styles - giữ lại font hiện tại */
.swal2-popup {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif !important;
}

.swal2-title {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif !important;
}

.swal2-html-container {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif !important;
}



.swal2-confirm,
.swal2-cancel,
.swal2-deny {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif !important;
}

/* Dark theme variables */

/* Score history horizontal scroll */
#score-history-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

#score-history-list::-webkit-scrollbar {
    height: 6px;
}

#score-history-list::-webkit-scrollbar-track {
    background: transparent;
}

#score-history-list::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

#score-history-list::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 163, 175, 0.7);
}

/* Theater Mode Styles */
body.theater-mode #main-header {
    display: none !important;
}

body.theater-mode #main-footer {
    display: none !important;
}

body.theater-mode #main-container {
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Line clamp utility */