/* Vanilla KVideo Global Styles */

/* Reset & Basic Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #121212;
    color: #f0f0f0;
    overflow: hidden; /* Prevent body scroll, handle scroll in main */
}

/* Layout */
#app {
    display: flex; /* Fallback for older flexbox */
    display: -webkit-flex; 
    height: 100%;
    width: 100%;
}

/* Sidebar */
#sidebar {
    width: 240px;
    height: 100%;
    background: rgba(30, 30, 30, 0.8);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    z-index: 10;
}

.sidebar-header {
    padding: 0 20px 20px;
}
.sidebar-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

#nav-menu {
    display: flex;
    flex-direction: column;
}

.nav-item {
    padding: 15px 20px;
    text-decoration: none;
    color: #aaa;
    font-size: 16px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.nav-item i {
    margin-right: 12px;
    font-style: normal;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-left: 4px solid #3b82f6;
}

/* Main Content Area */
#main-content {
    flex: 1;
    -webkit-flex: 1;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
    position: relative;
    background-color: #0a0a0a;
}

.header-glass {
    padding: 24px;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-glass h1 {
    font-size: 28px;
    font-weight: 600;
}

.content-padding {
    padding: 24px;
}

/* Utility Components */
.glass-effect {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.card {
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: #3b82f6;
}

button {
    cursor: pointer;
    font-size: 16px;
    outline: none;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    padding: 14px 24px;
    border-radius: 8px;
    font-weight: 600;
}

.btn-primary:active {
    background: #2563eb;
    transform: scale(0.98);
}

/* Player Overlay */
#player-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

#player-overlay.hidden {
    display: none;
}

.player-header {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: rgba(20, 20, 20, 0.9);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.btn-icon {
    background: transparent;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    margin-right: 16px;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.video-container {
    flex: 1;
    position: relative;
    background: #000;
}

video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    display: none;
}

/* Responsive for iPad/Mobile */
@media screen and (max-width: 768px) {
    #app {
        flex-direction: column-reverse;
    }
    #sidebar {
        width: 100%;
        height: 60px;
        flex-direction: row;
        padding: 0;
        border-right: none;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    .sidebar-header {
        display: none;
    }
    #nav-menu {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        align-items: center;
    }
    .nav-item {
        flex: 1;
        justify-content: center;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    .nav-item.active {
        border-left: none;
        border-bottom: 3px solid #3b82f6;
    }
    .nav-item i {
        margin-right: 0;
        margin-bottom: 4px;
        display: block;
        text-align: center;
    }
    .nav-item {
        flex-direction: column;
        font-size: 12px;
        padding: 8px;
    }
}
