/* KTG Framework Global Styles - Immersive Experience */

:root {
  /* Theme Variables - Dark (default) */
  --primary-bg: #111;
  --secondary-bg: #222;
  --accent-color: #2f27c8;
  --accent-hover: #4fb6c1;
  --text-primary: #fff;
  --text-secondary: #ccc;
  --border-radius: 20px;
  --transition: all 0.3s ease;
  --submenu-border: 5px solid var(--accent-color);
}

/* Light Theme */
[data-theme="light"] {
  --primary-bg: #f5f5f5;
  --secondary-bg: #fff;
  --accent-color: #2f27c8;
  --accent-hover: #4fb6c1;
  --text-primary: #333;
  --text-secondary: #666;
}

/* Custom Theme */
[data-theme="custom"] {
  --primary-bg: #0a0a0a;
  --secondary-bg: #1a1a1a;
  --accent-color: #00ffbb;
  --accent-hover: #ff6b6b;
  --text-primary: #fff;
  --text-secondary: #aaa;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  background-color: var(--primary-bg);
  color: var(--text-primary);
  margin: 0;
  overflow: hidden;
}

/* Main Container - Immersive Layout */
.ktg-container {
  display: flex;
  height: 100vh;
}

/* Fixed Sidebar - Left Navigation */
.ktg-sidebar {
  width: 80px;
  background-color: var(--primary-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  position: fixed;
  height: 100%;
  top: 54px;
  left: 0;
  z-index: 100;
  overflow-y: auto;
}

.ktg-sidebar .ktg-logo {
  margin-top: 10px;
  margin-bottom: 50px;
}

.ktg-sidebar .ktg-logo img {
  width: 60px;
  cursor: pointer;
  transition: var(--transition);
}

.ktg-sidebar .ktg-logo img:hover {
  transform: scale(1.1);
}

.ktg-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.ktg-nav-item {
  margin-bottom: 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.ktg-nav-item:hover {
  transform: scale(1.05);
}

.ktg-nav-item img {
  width: 32px;
  height: 32px;
  margin-bottom: 5px;
}

.ktg-nav-item span {
  font-size: 10px;
  display: block;
  text-align: center;
}

.ktg-nav-item.active {
  background-color: var(--accent-color);
  border-radius: var(--border-radius);
  padding: 8px;
}

/* Fixed Header Bar */
.ktg-header {
  background-color: var(--primary-bg);
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
}

.ktg-header h1 {
  margin: 0;
  font-size: 16px;
}

.ktg-header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.ktg-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ktg-now-playing {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Main Content Area */
.ktg-main-content {
  flex: 1;
  padding: 3px 5px 0 0;
  height: 100vh;
  overflow: hidden;
}

.ktg-content-area {
  display: flex;
  height: calc(100vh - 50px);
  margin-top: 0;
  padding-top: 0;
}

.ktg-left-panel {
  width: 50%;
  height: 100%;
  background-color: var(--secondary-bg);
  border: none;
  border-radius: 0;
  margin-left: 120px;
}

.ktg-right-panel {
  width: 50%;
  height: 100%;
  background-color: var(--secondary-bg);
  border: none;
  border-radius: 0;
  margin-left: 0;
  overflow-y: auto;
}

.ktg-left-panel iframe,
.ktg-right-panel iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Background Video */
.ktg-bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

/* Submenu System */
.ktg-submenu-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  pointer-events: none;
}

.ktg-submenu {
  position: absolute;
  top: 110px;
  left: 110px;
  background-color: rgba(1, 1, 1, 0.9);
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.5);
  border: var(--submenu-border);
  padding: 20px;
  min-width: 200px;
  border-radius: var(--border-radius);
  z-index: 1001;
  pointer-events: auto;
  display: none;
}

.ktg-submenu h2 {
  margin-top: 0;
  color: var(--text-primary);
}

.ktg-submenu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ktg-submenu li {
  margin-bottom: 10px;
}

.ktg-submenu button {
  background-color: transparent;
  border: 1px solid var(--accent-color);
  color: var(--text-primary);
  padding: 10px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.ktg-submenu button:hover {
  background-color: var(--secondary-bg);
  border-color: var(--accent-hover);
}

.ktg-submenu button img {
  max-width: 25px;
  max-height: 25px;
  margin-right: 5px;
  vertical-align: middle;
}

.ktg-submenu a {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 0;
  border-radius: var(--border-radius);
}

.ktg-close-button {
  float: right;
  cursor: pointer;
  margin-left: 10px;
}

.ktg-close-button:hover {
  color: red;
}

/* Music Controls */
#musicToggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

#musicToggle img {
  width: 30px;
  height: 30px;
}

/* Progress Bar */
.ktg-progress-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background-color: var(--secondary-bg);
  z-index: 1002;
}

.ktg-progress-bar {
  height: 100%;
  width: 0;
  background-color: var(--accent-color);
  transition: width 0.1s ease;
}

/* Animations */
.slide-in-left {
  opacity: 0;
  transform: translateX(-100%);
  transition: transform 1s ease-in-out, opacity 1s ease-in-out;
}

.slide-in-left.active {
  opacity: 1;
  transform: translateX(0);
}

.fade-in {
  opacity: 0;
  transition: opacity 2s ease-in-out;
}

.fade-in.active {
  opacity: 1;
}

/* Mobile/Tablet Responsive */
@media (max-width: 768px) {
  .ktg-sidebar {
    width: 100%;
    height: 80px;
    flex-direction: row;
    position: fixed;
    bottom: 0;
    top: auto;
    padding: 10px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  
  .ktg-sidebar .ktg-logo {
    margin: 0 20px 0 0;
  }
  
  .ktg-sidebar .ktg-logo img {
    width: 40px;
  }
  
  .ktg-nav-list {
    display: flex;
    gap: 20px;
  }
  
  .ktg-nav-item {
    margin-bottom: 0;
    min-width: 60px;
  }
  
  .ktg-nav-item img {
    width: 24px;
    height: 24px;
  }
  
  .ktg-nav-item span {
    font-size: 8px;
  }
  
  .ktg-content-area {
    flex-direction: column;
    height: calc(100vh - 130px);
  }
  
  .ktg-left-panel {
    width: 100%;
    height: 100%;
    margin-left: 0;
  }
  
  .ktg-right-panel {
    display: none;
  }
  
  .ktg-header {
    padding: 0 10px;
  }
  
  .ktg-header h1 {
    font-size: 14px;
  }
  
  .ktg-now-playing {
    display: none;
  }
  
  .ktg-submenu {
    top: 60px;
    left: 20px;
    right: 20px;
    width: auto;
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

/* Hide scrollbars where needed */
.ktg-sidebar::-webkit-scrollbar,
.ktg-container::-webkit-scrollbar {
  display: none;
}

.ktg-sidebar,
.ktg-container {
  scrollbar-width: none;
}