/* Main CSS File - Import all component styles */

/* Base Styles */
@import url('../css/variables.css');
@import url('../css/base.css');

/* Layout */
@import url('../css/layout/header.css');
@import url('../css/layout/footer.css');

/* Components */
@import url('../css/components/timer.css');
@import url('../css/components/buttons.css');

/* Modals */
@import url('../css/modals/base-modal.css');
@import url('../css/modals/settings-modal.css');
@import url('../css/modals/scene-modal.css');
@import url('../css/modals/white-noise-modal.css');
@import url('../css/modals/music-modal.css');

/* Responsive */
@import url('../css/responsive/mobile.css');
@import url('../css/responsive/desktop.css');



/* Fullscreen styles */
:fullscreen {
    background: var(--bg-primary);
}

:-webkit-full-screen {
    background: var(--bg-primary);
}

:-moz-full-screen {
    background: var(--bg-primary);
}

:-ms-fullscreen {
    background: var(--bg-primary);
}

/* Fullscreen button hover effect */
#fullscreen-btn {
    transition: all var(--transition-speed) ease;
}

#fullscreen-btn:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

/* Activity Heatmap Styles */
.day-square {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: #e0e0e0;
    margin: 2px;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s ease;
}

.day-square:hover {
    transform: scale(1.2);
}

.day-square.low-activity {
    background: #c8e6c9; /* Light green */
}

.day-square.medium-activity {
    background: #81c784; /* Medium green */
}

.day-square.high-activity {
    background: #4caf50; /* Dark green */
}
/* Canva Background Container Styles */
#canva-background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -9999; /* Đặt z-index rất thấp để ở dưới tất cả */
    pointer-events: none; /* Không nhận sự kiện chuột */
}

#canva-background-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none; /* Quan trọng: iframe không nhận sự kiện */
}

/* Đảm bảo body có z-index stack context */
body {
    position: relative;
    z-index: 0;
}

/* Đảm bảo các modal và overlay có z-index cao hơn */
.modal-overlay {
    z-index: 10000;
}

.modal-content {
    z-index: 10001;
}

/* Đảm bảo các control buttons có z-index phù hợp */
.top-bar {
    z-index: 1000;
}

.bottom-left-controls,
.bottom-right-controls {
    z-index: 1000;
}

.timer-container {
    z-index: 1;
}

/* Khi có Canva background, ẩn background image */
body.has-canva-background {
    background-image: none !important;
}

/* Scene item selected state */
.scene-item.selected {
    border: 3px solid #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.scene-item.selected .scene-overlay {
    background: rgba(102, 126, 234, 0.3);
}
/* Scene Modal Selected State */
.scene-item {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.scene-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.scene-item.selected {
    border: 3px solid #667eea;
    box-shadow: 0 0 25px rgba(102, 126, 234, 0.6);
    transform: translateY(-5px);
}

.scene-item.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    z-index: 5;
}

/* Canva scene specific styles */
.scene-item.canva-scene {
    position: relative;
    overflow: hidden;
}

.scene-item.canva-scene iframe {
    transition: opacity 0.3s ease;
}

.scene-item.canva-scene .scene-loading-overlay {
    transition: all 0.3s ease;
}

/* Ensure modal content stays on top */
#scene-modal .modal-content {
    z-index: 10001;
    position: relative;
}

/* Background overlay for modals */
.modal-overlay {
    z-index: 10000;
    position: fixed;
}/* Canva Background Container Styles */
#canva-background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -9999;
    pointer-events: none;
}

#canva-background-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
}

/* Scene Item Styles - Quan trọng: Đảm bảo scene item có thể click */
.scene-item {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    overflow: hidden;
}

.scene-item.canva-scene {
    position: relative;
}

/* Đảm bảo iframe trong scene modal KHÔNG có pointer-events: none */
.scene-modal .scene-item iframe {
    pointer-events: auto !important; /* Cho phép tương tác trong modal */
}

/* Nhưng overlay phải ở trên iframe để có thể click */
.scene-item .scene-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2; /* Ở trên iframe */
}

.scene-item:hover .scene-overlay {
    opacity: 1;
}

.scene-item.selected {
    border: 3px solid #667eea;
    box-shadow: 0 0 25px rgba(102, 126, 234, 0.6);
}

.scene-item.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    z-index: 10;
}

/* Loading overlay phải ở trên cùng */
.scene-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5; /* Cao hơn iframe */
    transition: opacity 0.3s ease;
}

/* Đảm bảo scene grid items có thể click */
.scene-grid .scene-item {
    pointer-events: auto;
}

/* Video background container styles */
#video-background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -9999;
    pointer-events: none !important;
    background: #000;
    overflow: hidden;
}

#video-background-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none !important;
}

/* Video autoplay styles */
#canva-background-container iframe {
    pointer-events: none;
}
/* Đảm bảo video Canva chạy tự động */
#canva-background-container iframe {
    pointer-events: none;
    /* Đảm bảo video không bị dừng */
    animation: none !important;
}

/* Force video playback */
#canva-background-container {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Prevent any interference with video playback */
body.has-canva-background {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}   