/* CSS Variables for Theme Management */
:root {
  /* Dark Theme Colors */
  --primary-bg: #0f0f0f;
  --secondary-bg: #1a1a1a;
  --tertiary-bg: #2a2a2a;
  --accent-bg: #3a3a3a;
  --primary-text: #ffffff;
  --secondary-text: #b3b3b3;
  --accent-text: #4a9eff;
  --border-color: #333333;
  --hover-color: #4a4a4a;
  --success-color: #4ade80;
  --warning-color: #fbbf24;
  --error-color: #ef4444;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  /* Light Theme Colors */
  --primary-bg: #ffffff;
  --secondary-bg: #f8fafc;
  --tertiary-bg: #e2e8f0;
  --accent-bg: #cbd5e1;
  --primary-text: #1e293b;
  --secondary-text: #64748b;
  --accent-text: #2563eb;
  --border-color: #d1d5db;
  --hover-color: #f1f5f9;
  --success-color: #059669;
  --warning-color: #d97706;
  --error-color: #dc2626;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--primary-bg);
  color: var(--primary-text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: var(--transition);
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.5s ease;
}

.loading-content {
  text-align: center;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--accent-text);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

/* Header */
.header {
  background: var(--header-bg);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 100%;
}

/* Hamburger Menu */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 30px;
  position: relative;
  z-index: 1001;
}

.hamburger-line {
  width: 25px;
  height: 3px;
  background: var(--primary-text);
  transition: all 0.3s ease;
  transform-origin: center;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Channels Button (now in player controls) */
.mobile-channels-btn {
  display: none;
}

/* Mobile only controls */
.mobile-only {
  display: none !important;
}

@media (max-width: 768px) {
  .mobile-only {
    display: inline-flex !important;
  }
}

/* Favorite button */
#favoriteBtn {
  transition: all 0.3s ease;
}

#favoriteBtn.active {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
}

#favoriteBtn.active i {
  color: #e74c3c;
}

#favoriteBtn:hover {
  background: rgba(231, 76, 60, 0.1);
}

.mobile-channels-btn:hover {
  background: var(--hover-color);
}

.mobile-channels-btn i {
  font-size: 1.1rem;
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  padding-top: 80px; /* Account for header height */
}

.mobile-menu.active {
  display: block;
}

.mobile-menu-content {
  padding: 2rem;
  max-width: 400px;
  margin: 0 auto;
}

.mobile-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.mobile-menu-item label {
  color: var(--primary-text);
  font-weight: 500;
  font-size: 1.1rem;
}

.mobile-menu-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--tertiary-bg);
  border: 1px solid var(--border-color);
  color: var(--primary-text);
  padding: 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
  background: var(--hover-bg);
  transform: translateY(-2px);
}

.mobile-menu-btn i {
  width: 24px;
  text-align: center;
  font-size: 1.2rem;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.logo {
  height: 2rem;
  width: auto;
}

.logo-section h1 {
  color: var(--primary-text);
  font-size: 1.5rem;
  margin: 0;
  font-weight: 600;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Mobile modal adjustments */
.modal.mobile-active {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  margin: 0;
  border-radius: 0;
  height: 100vh;
  overflow-y: auto;
}

.modal.mobile-active .modal-content {
  height: 100%;
  border-radius: 0;
  padding: 2rem 1rem;
  padding-top: 4rem;
}

/* Mobile Channels Side Menu */
.mobile-channels-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3000;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.mobile-channels-menu.active {
  visibility: visible;
  opacity: 1;
}

.mobile-channels-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.mobile-channels-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 320px;
  max-width: 85vw;
  height: 100%;
  background: rgba(15, 15, 15, 0.95); /* Semi-transparent background */
  backdrop-filter: blur(10px); /* Add blur effect for modern browsers */
  -webkit-backdrop-filter: blur(10px); /* Safari support */
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  padding: 1rem;
}

/* Light theme transparency support */
[data-theme="light"] .mobile-channels-content {
  background: rgba(255, 255, 255, 0.95); /* Semi-transparent white background for light theme */
}

.mobile-channels-menu.active .mobile-channels-content {
  transform: translateX(0);
}

.mobile-channels-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.mobile-channels-header h3 {
  color: var(--primary-text);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}

.close-mobile-channels {
  background: none;
  border: none;
  color: var(--primary-text);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: var(--transition);
  font-size: 1.1rem;
}

.close-mobile-channels:hover {
  background: var(--hover-color);
}

.mobile-channel-tabs {
  display: flex;
  margin-bottom: 1rem;
  background: var(--secondary-bg);
  border-radius: 8px;
  padding: 4px;
}

.mobile-channel-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--secondary-text);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  font-weight: 500;
}

.mobile-channel-tab.active {
  background: var(--accent-text);
  color: white;
}

.mobile-search-section {
  margin-bottom: 1rem;
}

.mobile-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.mobile-search-icon {
  position: absolute;
  left: 12px;
  color: var(--secondary-text);
  font-size: 0.9rem;
  z-index: 1;
}

.mobile-search-input-wrapper input {
  width: 100%;
  padding: 0.75rem 0.75rem 0.75rem 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--secondary-bg);
  color: var(--primary-text);
  font-size: 0.9rem;
  transition: var(--transition);
}

.mobile-search-input-wrapper input:focus {
  outline: none;
  border-color: var(--accent-text);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.mobile-clear-search-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--secondary-text);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  font-size: 0.8rem;
  opacity: 0;
  transition: var(--transition);
}

.mobile-clear-search-btn.visible {
  opacity: 1;
}

.mobile-clear-search-btn:hover {
  background: var(--hover-color);
  color: var(--primary-text);
}

.mobile-channels-list {
  flex: 1;
  overflow-y: auto;
}

.mobile-channels-container {
  display: block;
}

.mobile-channel-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: rgba(26, 26, 26, 0.8); /* Semi-transparent background */
  border: 1px solid rgba(51, 51, 51, 0.6); /* Semi-transparent border */
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.mobile-channel-item:hover {
  background: rgba(74, 74, 74, 0.8); /* Semi-transparent hover */
  transform: translateX(4px);
}

/* Light theme transparency for mobile channel items */
[data-theme="light"] .mobile-channel-item {
  background: rgba(248, 250, 252, 0.8); /* Semi-transparent light background */
  border: 1px solid rgba(209, 213, 219, 0.6); /* Semi-transparent light border */
}

[data-theme="light"] .mobile-channel-item:hover {
  background: rgba(241, 245, 249, 0.9); /* Semi-transparent light hover */
}

.mobile-channel-content {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.mobile-channel-item.active {
  background: var(--accent-text);
  color: white;
  border-color: var(--accent-text);
}

.mobile-channel-logo {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  margin-right: 0.75rem;
  object-fit: cover;
  background: var(--tertiary-bg);
  flex-shrink: 0;
}

.mobile-channel-info {
  flex: 1;
  min-width: 0;
}

.mobile-channel-name {
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0 0 0.25rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-channel-group {
  font-size: 0.8rem;
  color: var(--secondary-text);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-channel-item.active .mobile-channel-group {
  color: rgba(255, 255, 255, 0.8);
}

.mobile-channel-actions {
  flex-shrink: 0;
  margin-left: 8px;
}

.mobile-channel-favorite {
  background: none;
  border: none;
  color: var(--secondary-text);
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 16px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-channel-favorite:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ef4444;
}

.mobile-channel-favorite.active {
  color: #ef4444;
}

.mobile-channel-favorite.active i {
  color: #ef4444;
}

/* Mobile group items */
.mobile-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.mobile-group-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-group-item.expanded {
  background: rgba(var(--primary-color-rgb), 0.2);
}

.mobile-group-content {
  flex: 1;
}

.mobile-group-name {
  font-weight: 500;
  color: var(--primary-text);
  margin-bottom: 2px;
}

.mobile-group-count {
  font-size: 0.85rem;
  color: var(--secondary-text);
}

.mobile-group-toggle {
  color: var(--secondary-text);
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.mobile-group-item.expanded .mobile-group-toggle {
  transform: rotate(90deg);
}

.mobile-group-channels {
  display: none;
  padding-left: 20px;
  background: rgba(0, 0, 0, 0.2);
}

.mobile-group-channels.expanded {
  display: block;
}

.mobile-favorite-btn {
  background: none;
  border: none;
  color: var(--secondary-text);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: var(--transition);
  font-size: 1rem;
  flex-shrink: 0;
}

.mobile-favorite-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-favorite-btn.favorited {
  color: #ff6b6b;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
  }
  
  .desktop-controls {
    display: none;
  }
  
  .desktop-title {
    display: none;
  }
  
  .logo {
    display: none; /* Hide logo on mobile to save space */
  }
  
  .logo-section {
    justify-content: center;
  }
  
  .header {
    padding: 0.5rem 1rem;
  }
  
  /* Hide copyright on mobile */
  .footer {
    display: none;
  }
  
  /* Hide channel info on mobile to save space for video player */
  .channel-info {
    display: none !important; /* Force hide on mobile */
  }
  
  /* If channel info is shown programmatically, make it compact */
  .channel-info[style*="display: block"],
  .channel-info[style*="display: flex"] {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.5rem !important;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    max-height: 25vh; /* Limit height to 25% of viewport */
    overflow-y: auto;
  }
  
  .channel-info[style*="display: block"] .channel-info-content,
  .channel-info[style*="display: flex"] .channel-info-content {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
    text-align: left !important;
  }
  
  .channel-info[style*="display: block"] .channel-logo img,
  .channel-info[style*="display: flex"] .channel-logo img {
    width: 40px !important;
    height: 40px !important;
  }
  
  .channel-info[style*="display: block"] .channel-details h3,
  .channel-info[style*="display: flex"] .channel-details h3 {
    font-size: 1rem !important;
    margin: 0 !important;
  }
  
  .channel-info[style*="display: block"] .channel-details p,
  .channel-info[style*="display: flex"] .channel-details p {
    font-size: 0.8rem !important;
    margin: 0.2rem 0 0 0 !important;
  }
  
  /* Close button for mobile channel info */
  .mobile-close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
  }
  
  .mobile-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
  }
  
  /* Make video player larger on mobile since channel info is hidden */
  .video-container {
    height: 60vh !important; /* Increased from 50vh */
  }
  
  .player-container {
    height: 60vh !important; /* Increased from 50vh */
  }
  
  /* Make player controls more visible on mobile */
  .custom-controls {
    opacity: 1 !important; /* Always visible on mobile */
    background: rgba(0, 0, 0, 0.8);
    padding: 0.75rem;
  }

  /* Hide time display on mobile to save space */
  .time-display {
    display: none !important;
  }
  
  .controls-row {
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    justify-content: space-between;
  }
  
  .control-btn {
    min-width: 44px !important; /* iOS touch target minimum */
    min-height: 44px !important;
    padding: 8px !important; /* Reduced padding for more space */
    font-size: 14px !important; /* Smaller font size */
    flex-shrink: 0;
  }

  /* Volume control adjustments */
  .volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 120px;
  }

  .volume-slider-container {
    flex: 1;
    min-width: 60px;
  }

  .volume-level {
    font-size: 0.7rem;
    min-width: 30px;
  }
  
  /* Make fullscreen and other player buttons more prominent */
  .fullscreen-btn,
  .play-pause-btn,
  .volume-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 8px !important;
  }

  /* Optimize control button layout */
  .control-btn-custom {
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 8px !important;
    font-size: 14px !important;
    margin: 0 2px;
  }

  /* Control spacer adjustments */
  .control-spacer {
    flex: 0.5; /* Reduced flex to give more space to controls */
  }
  
  /* Quality and format selectors */
  .quality-selection,
  .format-selection {
    margin-bottom: 0.5rem;
  }
  
  .quality-selection select,
  .format-selection select {
    min-height: 44px;
    font-size: 16px;
    padding: 12px;
  }
  
  /* Video player adjustments for mobile */
  .video-player {
    height: 50vh !important;
  }

  /* Swipe gesture overlay for mobile */
  .swipe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    pointer-events: auto;
    touch-action: pan-x;
  }

  .swipe-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 15;
  }

  .swipe-indicator.left {
    left: 2rem;
  }

  .swipe-indicator.right {
    right: 2rem;
  }

  .swipe-indicator.show {
    opacity: 1;
  }
  
  /* Ensure player controls are always accessible on mobile */
  .player-container .custom-controls {
    position: relative !important;
    background: var(--secondary-bg) !important;
    opacity: 1 !important;
    border-top: 1px solid var(--border-color);
  }
  
  /* Make sidebar more accessible when playlist is shown */
  .sidebar {
    position: fixed;
    top: 60px; /* Account for header height */
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(100vh - 60px); /* Full height minus header */
    z-index: 1000;
    background: var(--primary-bg);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto; /* Enable scrolling for long playlists */
  }
  
  .sidebar:not(.collapsed) {
    transform: translateX(0);
  }
  
  /* Hide main content when sidebar is open on mobile */
  .content {
    transition: opacity 0.3s ease;
  }
  
  .sidebar:not(.collapsed) ~ .content {
    opacity: 0.3;
    pointer-events: none;
  }
  
  /* Mobile modal styles */
  .modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    border-radius: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 2000;
  }
  
  .modal-content {
    height: 100%;
    border-radius: 0;
    padding: 2rem 1rem;
    padding-top: 4rem;
    margin: 0;
    max-width: none;
  }
  
  .modal-header {
    position: sticky;
    top: 0;
    background: var(--secondary-bg);
    z-index: 1;
    margin: -2rem -1rem 2rem -1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
  }
}

@media (min-width: 769px) {
  .mobile-menu {
    display: none !important;
  }
  
  /* Hide swipe overlay and indicators on desktop */
  .swipe-overlay {
    display: none !important;
  }
  
  .swipe-indicator {
    display: none !important;
  }
}

.control-btn {
  background: var(--tertiary-bg);
  border: 1px solid var(--border-color);
  color: var(--primary-text);
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn:hover {
  background: var(--hover-color);
  transform: translateY(-1px);
}

.control-select,
.control-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  min-width: 150px;
}

.control-select option {
  background: #1a1a1a;
  color: white;
  padding: 8px;
}

[data-theme="light"] .control-select {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.2);
  color: #333;
}

[data-theme="light"] .control-select option {
  background: white;
  color: #333;
}

.control-select:focus,
.control-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.control-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* Main Container */
.main-container {
  display: flex;
  height: calc(100vh - 140px);
  position: relative;
}

/* Sidebar */
.sidebar {
  width: 350px;
  background: var(--secondary-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  z-index: 50;
}

.sidebar.collapsed {
  width: 0;
  overflow: hidden;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--tertiary-bg);
}

.upload-section {
  margin-bottom: 1.5rem;
}

.upload-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--accent-text);
  color: white;
  padding: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  width: 100%;
  justify-content: center;
}

.upload-btn:hover {
  background: #3b82f6;
  transform: translateY(-1px);
}

.search-section {
  margin-bottom: 1.5rem;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--secondary-text);
  z-index: 1;
}

#searchInput {
  width: 100%;
  background: var(--primary-bg);
  border: 1px solid var(--border-color);
  color: var(--primary-text);
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border-radius: 8px;
  transition: var(--transition);
  font-size: 0.875rem;
}

#searchInput:focus {
  outline: none;
  border-color: var(--accent-text);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.clear-search-btn {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--secondary-text);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: var(--transition);
  opacity: 0;
  visibility: hidden;
}

.clear-search-btn.visible {
  opacity: 1;
  visibility: visible;
}

.clear-search-btn:hover {
  background: var(--hover-color);
  color: var(--primary-text);
}

.controls-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.control-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.channel-count {
  background: var(--primary-bg);
  padding: 0.75rem;
  border-radius: 8px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--secondary-text);
  border: 1px solid var(--border-color);
}

/* Channel List */
.channel-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.channel {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 0.5rem;
  background: var(--tertiary-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.channel:hover {
  background: var(--hover-color);
  transform: translateX(4px);
}

.channel.selected {
  background: var(--accent-text);
  color: white;
  box-shadow: var(--shadow);
}

.channel.current-playing {
  border-left: 4px solid var(--success-color);
}

.channel.favorite {
  border-right: 4px solid var(--warning-color);
}

.channel-logo-small {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--accent-bg);
}

.channel-info-small {
  flex: 1;
  min-width: 0;
}

.channel-name {
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-group-small {
  font-size: 0.75rem;
  color: var(--secondary-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-favorite-btn {
  background: none;
  border: none;
  color: var(--secondary-text);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: var(--transition);
}

.channel-favorite-btn:hover {
  color: var(--warning-color);
}

.channel-favorite-btn.active {
  color: var(--warning-color);
}

/* Player Area */
.player-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--primary-bg);
  padding: 1rem;
  overflow: hidden;
  min-height: 0;
}

.player-container {
  flex: 1;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.video-player {
  width: 100%;
  height: 100%;
  background: #000;
}

.spinner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  display: none;
  color: white;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

/* Playlist Selector Section */
.playlist-selector-section {
  margin-bottom: 1.5rem;
}

.playlist-tabs {
  display: flex;
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.playlist-tab {
  flex: 1;
  background: var(--tertiary-bg);
  border: none;
  color: var(--secondary-text);
  padding: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
  font-weight: 500;
}

.playlist-tab:hover {
  background: var(--hover-color);
  color: var(--primary-text);
}

.playlist-tab.active {
  background: var(--accent-text);
  color: white;
}

.playlist-select {
  width: 100%;
  margin-bottom: 0.5rem;
}

/* Upload Controls in Modal */
.upload-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.upload-btn-modal {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--accent-text);
  color: white;
  padding: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  justify-content: center;
  border: none;
}

.upload-btn-modal:hover {
  background: #3b82f6;
  transform: translateY(-1px);
}

.uploaded-playlists {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.playlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--tertiary-bg);
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.playlist-name {
  font-size: 0.875rem;
  color: var(--primary-text);
}

.playlist-remove {
  background: var(--error-color);
  color: white;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
}

.playlist-remove:hover {
  background: #dc2626;
}

/* Custom Video Controls */
.custom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 15;
}

.player-container:hover .custom-controls,
.custom-controls:hover,
.custom-controls.show {
  opacity: 1;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.control-btn-custom {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 0.75rem;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  width: 40px;
  height: 40px;
}

.control-btn-custom:hover {
  background: var(--accent-text);
  transform: scale(1.1);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.volume-slider-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.volume-slider {
  width: 80px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent-text);
  border-radius: 50%;
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--accent-text);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.volume-level {
  font-size: 0.75rem;
  color: var(--accent-text);
  font-weight: 500;
  min-width: 35px;
}

.time-display {
  font-size: 0.875rem;
  color: white;
  font-weight: 500;
  white-space: nowrap;
}

.control-spacer {
  flex: 1;
}

.progress-container {
  width: 100%;
}

.progress-slider {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.progress-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-text);
  border-radius: 50%;
  cursor: pointer;
}

.progress-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent-text);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Video Format Classes */
.video-player.format-16-9 {
  aspect-ratio: 16/9;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: fill; /* Fill to fit player */
}

.video-player.format-4-3 {
  aspect-ratio: 4/3;
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: fill; /* Fill to fit player */
}

.video-player.format-21-9 {
  aspect-ratio: 21/9;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: fill; /* Fill to fit player */
}

.video-player.format-9-16 {
  aspect-ratio: 9/16;
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: fill; /* Fill to fit player */
}

.video-player.format-auto {
  width: 100%;
  height: 100%;
  object-fit: fill; /* Use fill for auto format to fit entire player */
}

/* Keep fill for fullscreen as well */
.video-player:fullscreen {
  object-fit: fill; /* Use fill for fullscreen to fit entire screen */
}

/* Add new class for responsive video without cropping */
.video-player.responsive {
  object-fit: fill; /* Fill entire player for responsive mode */
  max-width: 100%;
  max-height: 100%;
}

/* Fix for specific ratio issues */
.video-player.no-crop {
  object-fit: fill !important; /* Fill instead of contain to fit player */
}

.video-player:fullscreen::-webkit-media-controls {
  display: none !important;
}

.video-player:fullscreen::-webkit-media-controls-panel {
  display: none !important;
}

/* Hide custom controls in fullscreen */
.player-container:fullscreen .custom-controls {
  display: none !important;
}

.player-container:fullscreen .quality-selection {
  display: none !important;
}
.toggle-sidebar-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  min-width: 80px;
  justify-content: center;
}

.toggle-sidebar-btn .toggle-text {
  font-size: 0.875rem;
  font-weight: 500;
}

.sidebar.collapsed + .player-area .toggle-sidebar-btn {
  position: fixed;
  top: 50%;
  left: 1rem;
  z-index: 100;
  background: var(--accent-text);
  color: white;
  border: none;
  box-shadow: var(--shadow);
  border-radius: 8px;
  transform: translateY(-50%);
}

.sidebar.collapsed + .player-area .toggle-sidebar-btn:hover {
  background: #3b82f6;
  transform: translateY(-50%) scale(1.05);
}

/* Video Player Container Improvements */
/* Player Container - Fixed positioning */
.player-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden; /* Ensure video stays within bounds */
  display: flex;
  flex-direction: column;
  min-height: 300px;
  max-height: calc(100vh - 200px);
}

.video-player {
  width: 100%;
  height: 100%;
  object-fit: fill; /* Fill entire player area, stretching if necessary */
  background: #000;
  border-radius: 8px;
  flex: 1;
  max-width: 100%;
  max-height: 100%;
}

/* Remove native video controls completely */
.video-player::-webkit-media-controls {
  display: none !important;
}

.video-player::-webkit-media-controls-enclosure {
  display: none !important;
}

/* Custom Controls Enhancements */
.control-btn-custom {
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: white;
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
}

.control-btn-custom:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.control-btn-custom.casting {
  background: var(--accent-text);
  color: white;
}

.control-btn-custom.casting:hover {
  background: rgba(74, 158, 255, 0.9);
}

/* Quality and Subtitles Buttons */
#qualityBtn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quality-label {
  font-size: 0.8rem;
  font-weight: 500;
}

/* Quality and Subtitles Dropdowns */
.quality-dropdown,
.subtitles-dropdown {
  position: absolute;
  bottom: 100%;
  right: 60px;
  margin-bottom: 10px;
  z-index: 25;
}

.quality-menu,
.subtitles-menu {
  background: rgba(0, 0, 0, 0.95);
  border-radius: 8px;
  padding: 0.5rem 0;
  min-width: 150px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.quality-menu-header,
.subtitles-menu-header {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.25rem;
}

.quality-option,
.subtitles-option {
  padding: 0.5rem 1rem;
  color: var(--primary-text);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background-color 0.2s ease;
}

.quality-option:hover,
.subtitles-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.quality-option.active,
.subtitles-option.active {
  background: var(--accent-text);
  color: white;
}

.quality-option.active:hover,
.subtitles-option.active:hover {
  background: rgba(74, 158, 255, 0.9);
}

/* Fix Video.js player positioning */
.video-js {
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
}

.video-js .vjs-control-bar {
  background: rgba(0, 0, 0, 0.8) !important;
  border-radius: 8px 8px 0 0 !important;
  margin: 0 8px 8px 8px !important;
}

.video-js .vjs-big-play-button {
  background: rgba(0, 0, 0, 0.8) !important;
  border: 2px solid var(--accent-text) !important;
  border-radius: 50% !important;
  width: 80px !important;
  height: 80px !important;
  line-height: 76px !important;
  font-size: 2rem !important;
}

.video-js .vjs-big-play-button:hover {
  background: var(--accent-text) !important;
}

/* Quality Selection Improvements */
.quality-selection {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 0.75rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  z-index: 20;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.player-container:hover .quality-selection,
.quality-selection:hover,
.quality-selection.show {
  opacity: 1;
}

.quality-selection label {
  font-weight: 500;
  white-space: nowrap;
}

.quality-selection select {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
  min-width: 80px;
}

.quality-selection select option {
  background: #1a1a1a;
  color: white;
}

/* Settings Modal Improvements */
.setting-group {
  margin-bottom: 1.5rem;
}

.setting-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--primary-text);
}

.setting-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--secondary-text);
  opacity: 0.8;
  font-style: italic;
}

.setting-group select.control-select {
  width: 100%;
  background: var(--tertiary-bg);
  border: 1px solid var(--border-color);
  color: var(--primary-text);
  padding: 0.75rem;
  border-radius: 8px;
  transition: var(--transition);
  font-size: 0.875rem;
}

.setting-group select.control-select:focus {
  outline: none;
  border-color: var(--accent-text);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.setting-group select.control-select option {
  background: var(--tertiary-bg);
  color: var(--primary-text);
  padding: 0.5rem;
}

/* Light theme option styling */
[data-theme="light"] .quality-selection select option {
  background: #f8fafc;
  color: #1e293b;
}

[data-theme="light"] .setting-group select.control-select option {
  background: #f8fafc;
  color: #1e293b;
}

/* Channel Info */
.channel-info {
  background: var(--secondary-bg);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem;
}

.channel-info-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 1200px;
}

.channel-logo img {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--accent-bg);
}

.channel-details {
  flex: 1;
  min-width: 0;
}

.channel-details h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary-text);
}

.channel-details p {
  color: var(--secondary-text);
  margin-bottom: 0.75rem;
}

.channel-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
}

.channel-group,
.channel-language {
  background: var(--tertiary-bg);
  color: var(--secondary-text);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.favorite-btn {
  background: none;
  border: 2px solid var(--border-color);
  color: var(--secondary-text);
  padding: 1rem;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.5rem;
}

.favorite-btn:hover {
  border-color: var(--warning-color);
  color: var(--warning-color);
}

.favorite-btn.active {
  border-color: var(--warning-color);
  color: var(--warning-color);
  background: rgba(251, 191, 36, 0.1);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--secondary-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: var(--secondary-text);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: var(--transition);
  font-size: 1.25rem;
}

.close-btn:hover {
  background: var(--hover-color);
  color: var(--primary-text);
}

.modal-body {
  padding: 1.5rem;
}

.setting-group {
  margin-bottom: 1.5rem;
}

.setting-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--primary-text);
}

.setting-group input[type="url"],
.setting-group input[type="text"] {
  width: 100%;
  background: var(--primary-bg);
  border: 1px solid var(--border-color);
  color: var(--primary-text);
  padding: 0.75rem;
  border-radius: 8px;
  transition: var(--transition);
  margin-bottom: 0.5rem;
}

.setting-group input[type="url"]:focus,
.setting-group input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-text);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.setting-group input[type="checkbox"] {
  margin-right: 0.5rem;
}

.setting-group button {
  background: var(--accent-text);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.setting-group button:hover {
  background: #3b82f6;
}

.danger-btn {
  background: var(--error-color) !important;
}

.danger-btn:hover {
  background: #dc2626 !important;
}

/* Auto Stream Restart Styles */
.stream-restart-interval {
  margin-top: 0.5rem;
  padding-left: 1rem;
}

.interval-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.interval-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.interval-preset-btn {
  background: var(--secondary-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.interval-preset-btn:hover {
  background: var(--accent-color-10);
  border-color: var(--accent-color);
}

.interval-preset-btn.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.custom-interval-btn {
  min-width: 80px;
}

.custom-interval-input {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--secondary-bg);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.interval-input {
  width: 80px;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--background);
  color: var(--text-color);
  font-size: 0.85rem;
}

.interval-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-color-10);
}

.interval-apply-btn {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}

.interval-apply-btn:hover {
  background: #3b82f6;
}

.interval-display {
  margin-top: 0.5rem;
}

.interval-display strong {
  color: var(--accent-color);
}

/* Footer */
.footer {
  background: var(--secondary-bg);
  border-top: 1px solid var(--border-color);
  padding: 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.7;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  color: var(--secondary-text);
}

.divider {
  color: var(--border-color);
}

.author-link,
.github-link {
  color: var(--accent-text);
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.author-link:hover,
.github-link:hover {
  color: #3b82f6;
}

/* Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .sidebar {
    width: 300px;
  }
  
  .header-content {
    padding: 0 1rem;
  }
}

@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
    height: calc(100vh - 160px);
  }
  
  .sidebar {
    width: 100%;
    height: 50vh;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .sidebar.collapsed {
    height: 0;
    width: 100%;
  }
  
  .sidebar.collapsed + .player-area .toggle-sidebar-btn {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 100;
    background: var(--accent-text);
    color: white;
    border: none;
    box-shadow: var(--shadow);
    border-radius: 8px;
    transform: none;
  }
  
  .player-area {
    height: 50vh;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .logo-section {
    order: 1;
  }
  
  .header-controls {
    order: 2;
  }
  
  .channel-info-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .toggle-sidebar-btn .toggle-text {
    display: none;
  }
}

@media (max-width: 480px) {
  .sidebar {
    padding: 0.5rem;
  }
  
  .sidebar-header {
    padding: 1rem;
  }
  
  .channel {
    padding: 0.75rem;
  }
  
  .quality-selection {
    position: relative;
    top: auto;
    right: auto;
    background: var(--secondary-bg);
    color: var(--primary-text);
    margin: 0.5rem;
    opacity: 1 !important; /* Always visible on mobile */
  }
  
  .modal-content {
    width: 95%;
    margin: 1rem;
  }
}

/* Custom Scrollbar */
.channel-list::-webkit-scrollbar {
  width: 8px;
}

.channel-list::-webkit-scrollbar-track {
  background: var(--tertiary-bg);
  border-radius: 4px;
}

.channel-list::-webkit-scrollbar-thumb {
  background: var(--accent-bg);
  border-radius: 4px;
}

.channel-list::-webkit-scrollbar-thumb:hover {
  background: var(--hover-color);
}

/* Focus Styles for Accessibility */
.control-btn:focus,
.upload-btn:focus,
.channel:focus {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

/* Show Playlist Button */
.show-playlist-btn {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.show-playlist-btn span {
  display: none;
}

/* Font Size Classes */
.font-small {
  font-size: 14px;
}

.font-medium {
  font-size: 16px;
}

.font-large {
  font-size: 18px;
}

.font-extra-large {
  font-size: 20px;
}

/* Player Size Classes */
.player-small .player-container {
  max-height: 300px;
}

.player-medium .player-container {
  max-height: 500px;
}

.player-large .player-container {
  max-height: 700px;
}

/* Adaptive Video Format Classes */
.video-player.format-auto {
  aspect-ratio: auto;
}

.video-player.format-16-9 {
  aspect-ratio: 16/9;
}

.video-player.format-4-3 {
  aspect-ratio: 4/3;
}

.video-player.format-21-9 {
  aspect-ratio: 21/9;
}

.video-player.format-9-16 {
  aspect-ratio: 9/16;
}

/* Playlist Management Styles */
.playlist-management {
  margin-top: 1rem;
}

.url-playlist-section {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--tertiary-bg);
  border-radius: 8px;
}

.url-input-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.url-input-group input {
  flex: 1;
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  color: var(--primary-text);
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.875rem;
}

.url-input-group input:focus {
  outline: none;
  border-color: var(--accent-text);
}

.playlist-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.playlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--secondary-bg);
}

.playlist-item:last-child {
  border-bottom: none;
}

.playlist-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.playlist-name {
  font-weight: 500;
  color: var(--primary-text);
}

.playlist-channels {
  font-size: 0.875rem;
  color: var(--secondary-text);
}

.playlist-actions {
  display: flex;
  gap: 0.5rem;
}

.playlist-action-btn {
  background: var(--tertiary-bg);
  border: 1px solid var(--border-color);
  color: var(--primary-text);
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.playlist-action-btn:hover {
  background: var(--hover-color);
}

.rename-btn:hover {
  background: var(--warning-color);
  color: white;
}

.delete-btn:hover {
  background: var(--error-color);
  color: white;
}

.activate-btn:hover {
  background: var(--success-color);
  color: white;
}

.active-btn {
  background: var(--success-color);
  color: white;
}

.no-playlists {
  padding: 2rem;
  text-align: center;
  color: var(--secondary-text);
  font-style: italic;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .show-playlist-btn span {
    display: inline;
  }
  
  .header-controls {
    gap: 0.5rem;
  }
  
  .url-input-group {
    flex-direction: column;
  }
  
  .playlist-item {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .playlist-actions {
    width: 100%;
    justify-content: space-around;
  }
  
  .font-small { font-size: 12px; }
  .font-medium { font-size: 14px; }
  .font-large { font-size: 16px; }
  .font-extra-large { font-size: 18px; }
}

@media (max-width: 480px) {
  .show-playlist-btn {
    padding: 0.5rem;
  }
  
  .show-playlist-btn span {
    display: none;
  }
  
  .player-small .player-container,
  .player-medium .player-container,
  .player-large .player-container {
    max-height: none;
    height: 200px;
  }
}

/* Print Styles */
@media print {
  .header,
  .sidebar,
  .footer,
  .modal {
    display: none;
  }
  
  .player-area {
    width: 100%;
    height: 100vh;
  }
}

/* Groups styling */
.groups-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.group-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: #3a4452;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #4a5568;
}

.group-item:hover {
  background: #4a5568;
  border-color: #6366f1;
  transform: translateY(-1px);
}

.group-item.expanded .group-icon {
  transform: rotate(90deg);
}

.group-icon {
  margin-right: 10px;
  color: #94a3b8;
  font-size: 12px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.group-info {
  flex: 1;
}

.group-name {
  font-weight: 500;
  color: #f1f5f9;
  font-size: 14px;
  margin-bottom: 2px;
}

.group-description {
  font-size: 12px;
  color: #94a3b8;
}

.group-count {
  background: #6366f1;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  min-width: 20px;
  text-align: center;
}

/* Group Channels */
.group-channels {
  margin: 0 0 15px 30px;
  border-left: 2px solid #4a5568;
  padding-left: 15px;
  animation: slideDown 0.2s ease-out;
}

.group-channel-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #2a3441;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 5px;
  border: 1px solid #3a4452;
}

.group-channel-item:hover {
  background: #3a4452;
  border-color: #6366f1;
  transform: translateX(5px);
}

.group-channel-item .channel-info {
  display: flex;
  align-items: center;
  flex: 1;
}

.group-channel-item .channel-name {
  font-size: 13px;
  color: #f1f5f9;
  font-weight: 400;
}

.group-channel-item .channel-logo {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  margin-left: 8px;
  object-fit: cover;
}

.group-channel-item i {
  color: #94a3b8;
  font-size: 14px;
  transition: color 0.2s ease;
}

.group-channel-item i:hover {
  color: #ef4444;
}

.group-channel-item i.favorite-active {
  color: #ef4444;
}

.no-channels {
  text-align: center;
  padding: 15px;
  color: #94a3b8;
  font-style: italic;
  font-size: 13px;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    max-height: 500px;
    transform: translateY(0);
  }
}

/* Desktop Group Channels */
.desktop-group-wrapper {
  margin-bottom: 15px;
}

.desktop-group-channels {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease-out;
  border-left: 3px solid #6366f1;
  margin-left: 20px;
  background: #1a1f2e;
  border-radius: 0 8px 8px 0;
}

.desktop-group-channels.expanded {
  max-height: 1000px;
  opacity: 1;
  padding: 10px 0;
}

.desktop-channel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
}

.desktop-channel-item:hover {
  background: rgba(99, 102, 241, 0.1);
  transform: translateX(5px);
}

.desktop-channel-item.active {
  background: rgba(99, 102, 241, 0.2);
  border-left: 3px solid #6366f1;
}

.desktop-channel-item:last-child {
  border-bottom: none;
}

.desktop-channel-content {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.desktop-channel-logo {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  margin-right: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.desktop-channel-info {
  flex: 1;
  min-width: 0;
}

.desktop-channel-name {
  font-size: 14px;
  font-weight: 500;
  color: #f1f5f9;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desktop-channel-group {
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desktop-channel-actions {
  flex-shrink: 0;
  margin-left: 12px;
}

.desktop-channel-favorite {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.desktop-channel-favorite:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.desktop-channel-favorite.active {
  color: #ef4444;
}

.desktop-channel-favorite.active:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Back to All Channels Button */
.back-to-all-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  padding: 10px;
  background: #1f2937;
  border-radius: 8px;
  border: 1px solid #374151;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #6366f1;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.back-btn:hover {
  background: #5856eb;
}

.group-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  font-size: 14px;
}

.group-indicator i {
  color: #6366f1;
}

/* No Playlist Message */
.no-playlist-message {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: #111827;
  color: #f3f4f6;
}

.message-content {
  text-align: center;
  max-width: 500px;
  padding: 40px;
}

.message-content i {
  color: #6366f1;
  margin-bottom: 20px;
}

.message-content h2 {
  margin: 20px 0 16px 0;
  font-size: 24px;
  font-weight: 600;
}

.message-content p {
  margin-bottom: 30px;
  color: #9ca3af;
  font-size: 16px;
  line-height: 1.5;
}

.upload-help {
  margin: 30px 0;
  text-align: left;
  background: #1f2937;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #374151;
}

.upload-help h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: #f3f4f6;
}

.upload-help ol {
  margin: 0;
  padding-left: 20px;
}

.upload-help li {
  margin: 8px 0;
  color: #d1d5db;
  font-size: 14px;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #6366f1;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.upload-btn:hover {
  background: #5856eb;
}

.no-content {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
  font-style: italic;
}

/* IPTV-org Import Styles */
.iptv-org-import {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.import-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.import-filters .control-select {
  flex: 1;
  min-width: 0;
}

.import-status {
  padding: 10px;
  border-radius: 4px;
  font-size: 14px;
  margin-top: 10px;
  display: none;
}

.import-status.success {
  background: rgba(74, 222, 128, 0.1);
  color: var(--success-color);
  border: 1px solid rgba(74, 222, 128, 0.3);
  display: block;
}

.import-status.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: block;
}

.import-status.loading {
  background: rgba(74, 158, 255, 0.1);
  color: var(--accent-text);
  border: 1px solid rgba(74, 158, 255, 0.3);
  display: block;
}

/* Channel Check Modal Styles */
.check-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.check-options label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--primary-text);
}

.check-options input[type="number"] {
  width: 80px;
  padding: 5px 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--secondary-bg);
  color: var(--primary-text);
  font-size: 13px;
}

.check-options input[type="checkbox"] {
  margin-left: 10px;
  accent-color: var(--accent-text);
}

.check-progress {
  margin: 20px 0;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--tertiary-bg);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-text), #4ade80);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 14px;
  color: var(--primary-text);
  margin-bottom: 5px;
}

.progress-details {
  font-size: 12px;
  color: var(--secondary-text);
  line-height: 1.4;
}

.check-results {
  margin-top: 20px;
}

.results-summary {
  background: var(--tertiary-bg);
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 15px;
}

.results-summary p {
  margin: 5px 0;
  font-size: 14px;
}

.unavailable-list {
  max-height: 200px;
  overflow-y: auto;
  margin: 10px 0;
  padding-left: 20px;
}

.unavailable-list li {
  margin: 5px 0;
  font-size: 13px;
  color: var(--secondary-text);
}

.check-results .success {
  color: var(--success-color);
  font-weight: 500;
  margin-top: 15px;
}

.check-results .error {
  color: var(--error-color);
  font-weight: 500;
  margin-top: 15px;
}

.check-results details {
  background: var(--tertiary-bg);
  border-radius: 6px;
  padding: 10px;
  margin-top: 10px;
}

.check-results details summary {
  cursor: pointer;
  font-weight: 500;
  padding: 5px 0;
  color: var(--warning-color);
}

.check-results details[open] summary {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
}

/* =========================================
   ULTRA SMALL SCREENS (≤ 576px)
   ========================================= */
@media (max-width: 576px) {
  
  /* Ultra compact layout */
  body {
    font-size: 12px;
    line-height: 1.3;
  }
  
  /* Header - Ultra minimal */
  .header {
    padding: 4px 8px;
    min-height: 36px;
  }
  
  .header-content {
    gap: 4px;
  }
  
  .logo {
    display: none; /* Hide logo on mobile to save space */
  }
  
  .desktop-title {
    font-size: 14px;
    margin: 0;
  }
  
  /* Hide desktop controls completely on ultra small screens */
  .desktop-controls {
    display: none !important;
  }
  
  /* Hamburger menu - smaller */
  .hamburger-btn {
    width: 28px;
    height: 28px;
    padding: 4px;
  }
  
  .hamburger-line {
    height: 2px;
    margin: 3px 0;
  }
  
  /* Main container - full screen usage */
  .main-container {
    flex-direction: column;
    height: calc(100vh - 36px);
  }
  
  /* Sidebar - overlay only */
  .sidebar {
    position: fixed;
    top: 36px;
    left: -100%;
    width: calc(100vw - 20px);
    height: calc(100vh - 36px);
    z-index: 1000;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    margin: 10px;
    border-radius: 8px;
    transition: left 0.3s ease;
  }
  
  .sidebar.active {
    left: 0;
  }
  
  /* Sidebar header - compact */
  .sidebar-header {
    padding: 8px;
    gap: 8px;
  }
  
  .playlist-tabs {
    gap: 4px;
  }
  
  .playlist-tab {
    padding: 4px 8px;
    font-size: 11px;
  }
  
  .playlist-select {
    font-size: 11px;
    padding: 4px;
  }
  
  .search-input-wrapper input {
    padding: 4px 24px 4px 8px;
    font-size: 11px;
  }
  
  .control-select {
    font-size: 11px;
    padding: 4px;
  }
  
  /* Channel list - ultra compact */
  .channel-item {
    padding: 6px 8px;
    gap: 6px;
  }
  
  .channel-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
  }
  
  .channel-name {
    font-size: 11px;
    line-height: 1.2;
  }
  
  .channel-group {
    font-size: 9px;
  }
  
  /* Player area - maximize space */
  .player-area {
    width: 100%;
    height: 100%;
    padding: 4px;
  }
  
  .player-container {
    height: calc(50vh);
    min-height: 200px;
    border-radius: 4px;
  }
  
  /* Video player - compact */
  .video-player {
    border-radius: 4px;
  }
  
  /* Custom controls - ultra minimal */
  .custom-controls {
    padding: 4px;
    gap: 4px;
  }
  
  .controls-row {
    gap: 4px;
    margin-bottom: 4px;
  }
  
  .control-btn-custom {
    width: 24px;
    height: 24px;
    font-size: 10px;
    padding: 0;
  }
  
  /* Volume control - simplified */
  .volume-control {
    gap: 4px;
  }
  
  .volume-slider-container {
    width: 40px;
  }
  
  .volume-level {
    font-size: 9px;
    padding: 1px 3px;
  }
  
  /* Time display - minimal */
  .time-display {
    font-size: 9px;
    gap: 2px;
  }
  
  /* Progress container */
  .progress-container {
    margin-top: 4px;
  }
  
  .progress-slider {
    height: 3px;
  }
  
  /* Channel info - compact */
  .channel-info {
    padding: 6px 8px;
  }
  
  .channel-info-content {
    gap: 6px;
  }
  
  .channel-details h3 {
    font-size: 12px;
    margin: 0 0 2px 0;
  }
  
  .channel-details p {
    font-size: 10px;
    margin: 0;
  }
  
  .channel-meta {
    gap: 6px;
    margin-top: 2px;
  }
  
  .channel-meta span {
    font-size: 9px;
    padding: 1px 4px;
  }
  
  .favorite-btn {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }
  
  /* Mobile menu - full screen */
  .mobile-menu {
    top: 36px;
    height: calc(100vh - 36px);
    padding: 8px;
  }
  
  .mobile-menu-item {
    padding: 6px 0;
  }
  
  .mobile-menu-item label {
    font-size: 11px;
  }
  
  .mobile-menu-btn {
    padding: 8px;
    font-size: 11px;
    gap: 6px;
  }
  
  /* Modals - full screen */
  .modal {
    padding: 8px;
  }
  
  .modal-content {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 8px;
  }
  
  .modal-header {
    padding: 8px 12px;
    gap: 8px;
  }
  
  .modal-header h2 {
    font-size: 14px;
  }
  
  .modal-body {
    padding: 8px 12px;
    font-size: 11px;
  }
  
  /* Buttons - minimum touch targets */
  .btn,
  .control-btn,
  .close-btn {
    min-width: 32px;
    min-height: 32px;
    padding: 4px 8px;
    font-size: 11px;
  }
  
  /* Form elements */
  input[type="text"],
  input[type="url"],
  input[type="file"],
  select,
  textarea {
    font-size: 12px;
    padding: 6px;
  }
  
  /* Loading screen */
  .loading-screen h2 {
    font-size: 16px;
  }
  
  .loading-spinner {
    width: 32px;
    height: 32px;
    border-width: 3px;
  }
  
  /* No playlist message */
  .no-playlist-message {
    padding: 12px;
  }
  
  .no-playlist-message h2 {
    font-size: 16px;
    margin-bottom: 8px;
  }
  
  .no-playlist-message p {
    font-size: 11px;
    margin-bottom: 8px;
  }
  
  .no-playlist-message ol {
    font-size: 10px;
  }
  
  .upload-btn {
    padding: 8px 12px;
    font-size: 11px;
    gap: 4px;
  }
  
  /* Swipe overlay adjustments */
  .swipe-overlay {
    font-size: 10px;
  }
  
  .swipe-indicator {
    padding: 6px 12px;
    font-size: 10px;
    border-radius: 4px;
  }
  
  /* Quality selection */
  .quality-selection {
    padding: 4px 8px;
    font-size: 10px;
  }
  
  /* Error messages and notifications */
  .error-message,
  .notification {
    font-size: 11px;
    padding: 6px 8px;
    border-radius: 4px;
  }
  
  /* Channel check results */
  .check-results {
    font-size: 10px;
  }
  
  .check-results h3 {
    font-size: 12px;
  }
  
  /* Groups styling for ultra small */
  .group-header {
    padding: 6px 8px;
    font-size: 11px;
  }
  
  .group-header h3 {
    font-size: 11px;
    margin: 0;
  }
  
  .group-channel-count {
    font-size: 9px;
    padding: 1px 4px;
  }
  
  /* Hide less important UI elements on ultra small screens */
  .channel-description,
  .time-display,
  .volume-level {
    display: none !important;
  }
  
  /* Simplify controls for ultra small screens */
  .control-spacer {
    display: none;
  }
  
  /* Make sure text is readable */
  * {
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
  }
}

/* PWA Support Styles */
.pwa-install-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin: 0 5px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.pwa-install-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-1px);
}

.pwa-standalone .pwa-install-btn {
  display: none;
}

.update-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--card-bg);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  padding: 16px;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: slideInRight 0.3s ease;
}

.update-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.update-content span {
  color: var(--text-color);
  font-weight: 500;
}

.update-content button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.3s ease;
}

.update-content button:hover {
  background: var(--secondary-color);
}

.update-content button:last-child {
  background: var(--muted-color);
}

.update-content button:last-child:hover {
  background: #666;
}

.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 16px;
  border-radius: 4px;
  color: white;
  font-size: 14px;
  z-index: 10000;
  animation: slideInUp 0.3s ease;
  max-width: 300px;
  word-wrap: break-word;
}

.notification.fade-out {
  animation: slideOutDown 0.3s ease;
}

.notification-info {
  background: var(--primary-color);
}

.notification-success {
  background: #28a745;
}

.notification-warning {
  background: #ffc107;
  color: #000;
}

.notification-error {
  background: #dc3545;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOutDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

/* PWA styles for ultra-small screens */
@media (max-width: 576px) {
  .pwa-install-btn {
    padding: 6px 8px;
    font-size: 16px;
    margin: 0 2px;
  }
  
  .update-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    padding: 12px;
  }
  
  .update-content {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .update-content button {
    padding: 8px 12px;
    font-size: 14px;
  }
  
  .notification {
    bottom: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* About Modal Styles */
.about-modal {
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
}

.about-content {
  padding: 0;
}

.app-info {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
}

.app-logo .about-icon {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.app-details {
  flex: 1;
}

.app-title {
  color: var(--primary-color);
  margin: 0 0 10px 0;
  font-size: 24px;
  font-weight: 600;
}

.app-version {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.version-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--primary-color);
  color: white;
}

.app-description {
  color: var(--secondary-text);
  line-height: 1.6;
  margin: 0;
  font-size: 14px;
}

.author-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
}

.author-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.author-avatar .author-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-color);
}

.author-name {
  margin: 0;
  color: var(--primary-text);
  font-size: 18px;
  font-weight: 600;
}

.author-role {
  margin: 5px 0 0 0;
  color: var(--secondary-text);
  font-size: 14px;
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--secondary-bg);
  color: var(--secondary-text);
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.tech-info {
  padding: 20px 0 0 0;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tech-badge {
  padding: 6px 12px;
  background: var(--accent-bg);
  color: var(--accent-text);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.copyright {
  text-align: center;
  color: var(--muted-color);
}

.about-btn {
  border-top: 1px solid var(--border-color) !important;
  margin-top: 10px !important;
  padding-top: 15px !important;
}

/* About Modal Responsive */
@media (max-width: 768px) {
  .about-modal {
    max-width: 95vw;
    margin: 20px;
  }
  
  .app-info {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .author-section {
    flex-direction: column;
    gap: 15px;
  }
  
  .tech-stack {
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .about-modal {
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
  }
  
  .app-logo .about-icon {
    width: 60px;
    height: 60px;
  }
  
  .app-title {
    font-size: 20px;
  }
  
  .author-avatar .author-photo {
    width: 40px;
    height: 40px;
  }
  
  .app-description {
    font-size: 13px;
  }
}
