/**
 * Desktop-Optimized Styles for Ethical Hacking Co
 * Enhanced UX and Native YouTube Experience
 *
 * @package EthicalHackingYouTube
 * @version 2.0.0
 */

/* ==========================================================================
   GLOBAL SPACING & LAYOUT IMPROVEMENTS
   ========================================================================== */

/* Better base container */
.wp-site-blocks {
  padding: 0 !important;
}

body {
  overflow-x: hidden;
}

/* Main content wrapper with proper spacing */
.ehc-homepage {
  max-width: 100%;
  margin: 0 auto;
}

/* Section spacing - TABLET ONLY (768px - 991px)
   Mobile styles are in mobile-responsive.css
   Desktop styles are in the 992px+ media query below */
@media screen and (min-width: 768px) and (max-width: 991px) {
  .ehc-section,
  .ehc-homepage > .wp-block-group {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  /* Inner content container */
  .ehc-section > .wp-block-columns,
  .ehc-section > .wp-block-group,
  .ehc-homepage > .wp-block-group > .wp-block-columns {
    max-width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Heading spacing */
  .ehc-section h2,
  .ehc-homepage h2.has-text-align-center {
    margin-bottom: 14px !important;
  }

  /* Paragraph after heading */
  .ehc-section h2 + p,
  .ehc-homepage h2 + p {
    margin-bottom: 32px !important;
  }
}

/* ==========================================================================
   DESKTOP-SPECIFIC BASE STYLES (992px+)
   ========================================================================== */
@media screen and (min-width: 992px) {

  /* Enhanced section spacing on desktop */
  .ehc-section,
  .ehc-homepage > .wp-block-group {
    padding-left: 60px !important;
    padding-right: 60px !important;
  }

  /* Inner content container - wider on desktop */
  .ehc-section > .wp-block-columns,
  .ehc-section > .wp-block-group,
  .ehc-homepage > .wp-block-group > .wp-block-columns {
    max-width: 1400px;
  }

  /* ==========================================================================
     HEADER & NAVIGATION - DESKTOP
     ========================================================================== */
  .ehc-site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--ehc-bg-primary, #0a0a0f) !important;
  }

  .ehc-top-bar {
    display: flex !important;
    padding: 8px 40px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .ehc-main-header {
    padding: 12px 40px !important;
    background: var(--ehc-bg-primary, #0a0a0f);
  }

  /* Desktop Navigation - Inline Links */
  .ehc-main-nav {
    display: flex !important;
    align-items: center;
    gap: 8px;
  }

  .ehc-main-nav .wp-block-navigation__container {
    display: flex !important;
    flex-direction: row !important;
    gap: 32px;
    background: transparent !important;
    position: static !important;
    width: auto !important;
    padding: 0 !important;
  }

  .ehc-main-nav .wp-block-navigation-item {
    margin: 0;
  }

  .ehc-main-nav .wp-block-navigation-item__content {
    color: var(--ehc-text-secondary, #e4e4e7) !important;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 4px;
    transition: color 0.2s ease;
    text-decoration: none !important;
  }

  .ehc-main-nav .wp-block-navigation-item__content:hover {
    color: var(--ehc-text-primary, #f8fafc) !important;
  }

  /* Hide hamburger menu on desktop */
  .ehc-main-nav .wp-block-navigation__responsive-container-open,
  .ehc-main-nav button.wp-block-navigation__responsive-container-open {
    display: none !important;
  }

  /* Ensure nav container is visible on desktop */
  .ehc-main-nav .wp-block-navigation__responsive-container {
    display: flex !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    padding: 0 !important;
  }

  .ehc-main-nav .wp-block-navigation__responsive-container.is-menu-open {
    position: static !important;
    background: transparent !important;
  }

  /* Header search - desktop width */
  .ehc-header-search {
    min-width: 200px;
  }

  .ehc-header-search .wp-block-search__inside-wrapper {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
  }

  .ehc-header-search input {
    background: transparent !important;
    color: var(--ehc-text-primary) !important;
  }

  /* Subscribe button styling */
  .ehc-header-subscribe .wp-block-button__link {
    background: #ff0000 !important;
    color: white !important;
    font-weight: 600;
    padding: 10px 20px !important;
    transition: all 0.2s ease;
  }

  .ehc-header-subscribe .wp-block-button__link:hover {
    background: #cc0000 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
  }

  /* ==========================================================================
     MAIN CONTENT CONTAINER
     ========================================================================== */

  /* Enhanced container width for desktop */
  .ehc-homepage {
    max-width: 100%;
    margin: 0 auto;
  }

  /* ==========================================================================
     HERO SECTION - THEATER MODE LAYOUT
     ========================================================================== */
  .ehc-hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    padding: 80px 60px 100px !important;
    position: relative;
    overflow: hidden;
  }

  /* Hero inner container */
  .ehc-hero > .wp-block-columns {
    max-width: 1400px;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100%;
  }

  /* Ambient gradient background */
  .ehc-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
      radial-gradient(ellipse 80% 50% at 20% 40%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
      radial-gradient(ellipse 60% 40% at 80% 60%, rgba(255, 0, 0, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
  }

  .ehc-hero > .wp-block-columns {
    position: relative;
    z-index: 1;
    gap: 80px;
  }

  /* Hero text column - enhanced typography */
  .ehc-hero .wp-block-column:first-child {
    flex-basis: 45% !important;
  }

  .ehc-hero h1 {
    font-size: clamp(42px, 4vw, 56px) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
  }

  .ehc-hero h1 span {
    background: linear-gradient(135deg, #ff0000, #ff4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .ehc-hero p {
    font-size: 20px !important;
    line-height: 1.7 !important;
    max-width: 520px;
    opacity: 0.9;
  }

  /* Hero buttons - larger on desktop */
  .ehc-hero .wp-block-buttons {
    margin-top: 40px !important;
    gap: 16px;
  }

  .ehc-hero .wp-block-button__link {
    padding: 16px 32px !important;
    font-size: 16px !important;
    font-weight: 600;
    transition: all 0.2s ease;
  }

  .ehc-hero .wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 0, 0, 0.25);
  }

  /* Hero video column - featured player */
  .ehc-hero .wp-block-column:last-child {
    flex-basis: 55% !important;
  }

  /* ==========================================================================
     NATIVE YOUTUBE PLAYER STYLING
     ========================================================================== */
  .ehc-featured-video {
    position: relative;
  }

  .ehc-featured-video .ehc-video-wrapper {
    border-radius: 16px !important;
    box-shadow:
      0 20px 60px rgba(0, 0, 0, 0.6),
      0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .ehc-featured-video .ehc-video-wrapper:hover {
    transform: scale(1.01);
    box-shadow:
      0 25px 80px rgba(0, 0, 0, 0.7),
      0 0 0 1px rgba(255, 255, 255, 0.08);
  }

  /* Theater mode toggle */
  .ehc-theater-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    color: white;
    font-size: 13px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .ehc-featured-video:hover .ehc-theater-btn {
    opacity: 1;
  }

  .ehc-theater-btn:hover {
    background: rgba(0, 0, 0, 0.9);
  }

  /* Ambient mode glow behind video */
  .ehc-ambient-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    filter: blur(100px);
    opacity: 0.4;
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.5s ease;
  }

  .ehc-featured-video.ambient-active .ehc-ambient-glow {
    opacity: 0.6;
  }

  /* ==========================================================================
     VIDEO GRID - DESKTOP ENHANCED
     ========================================================================== */
  .ehc-latest-section {
    padding: 100px 60px !important;
  }

  .ehc-latest-section h2 {
    font-size: 36px !important;
    margin-bottom: 16px;
  }

  .ehc-latest-section > p {
    margin-bottom: 48px !important;
  }

  .ehc-video-grid.ehc-cols-3 {
    gap: 28px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Enhanced video cards */
  .ehc-video-card {
    background: linear-gradient(180deg,
      rgba(30, 41, 59, 0.9) 0%,
      rgba(30, 41, 59, 0.7) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.25s ease;
  }

  .ehc-video-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 0, 0, 0.3);
    box-shadow:
      0 20px 40px rgba(0, 0, 0, 0.4),
      0 0 0 1px rgba(255, 0, 0, 0.1);
  }

  /* Video thumbnail enhancements */
  .ehc-video-card .ehc-thumbnail {
    position: relative;
    overflow: hidden;
  }

  .ehc-video-card .ehc-thumbnail::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  .ehc-video-card:hover .ehc-thumbnail::after {
    opacity: 1;
  }

  /* YouTube-style play button */
  .ehc-play-btn {
    width: 68px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .ehc-play-btn::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent white;
    margin-left: 4px;
  }

  .ehc-video-card:hover .ehc-play-btn {
    background: rgba(255, 0, 0, 1);
    transform: translate(-50%, -50%) scale(1.1);
  }

  /* Progress bar for watched videos */
  .ehc-watch-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: #ff0000;
    border-radius: 0 2px 0 0;
    z-index: 5;
  }

  /* Video info section */
  .ehc-video-title {
    font-size: 15px;
    padding: 16px 16px 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .ehc-video-meta {
    padding: 0 16px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
  }

  .ehc-video-meta::before {
    content: '';
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #ff0000, #cc0000);
    border-radius: 50%;
    flex-shrink: 0;
  }

  /* ==========================================================================
     COURSE TRACKS - DESKTOP CARDS
     ========================================================================== */
  .ehc-courses-section {
    padding: 100px 60px !important;
  }

  .ehc-courses-section h2 {
    margin-bottom: 16px !important;
  }

  .ehc-courses-section h2 + p {
    margin-bottom: 48px !important;
  }

  .ehc-courses-section .wp-block-columns {
    gap: 32px;
    max-width: 1400px;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .ehc-track-card {
    padding: 32px !important;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    height: 100%;
  }

  .ehc-track-card:hover {
    transform: translateY(-6px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  }

  .ehc-track-card h3 {
    font-size: 22px;
    margin-top: 16px;
  }

  .ehc-track-card ul {
    margin: 20px 0;
  }

  .ehc-track-card li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .ehc-track-card li:last-child {
    border-bottom: none;
  }

  /* ==========================================================================
     CERTIFICATION SECTION - DESKTOP
     ========================================================================== */
  .ehc-cert-section {
    padding: 100px 60px !important;
  }

  .ehc-cert-section h2 {
    margin-bottom: 16px !important;
  }

  .ehc-cert-section h2 + p {
    margin-bottom: 48px !important;
  }

  .ehc-cert-section .wp-block-columns {
    gap: 32px;
    max-width: 1200px;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .ehc-cert-section .wp-block-group {
    transition: all 0.25s ease;
    background: rgba(15, 23, 42, 0.5);
  }

  .ehc-cert-section .wp-block-group:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  }

  /* ==========================================================================
     MINI PLAYER - PICTURE IN PICTURE STYLE
     ========================================================================== */
  .ehc-mini-player {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 400px;
    z-index: 9998;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    transform: translateY(120%);
    transition: transform 0.3s ease;
    background: #000;
  }

  .ehc-mini-player.active {
    transform: translateY(0);
  }

  .ehc-mini-player .ehc-video-wrapper {
    margin: 0;
    border-radius: 0;
  }

  .ehc-mini-player-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 8px;
    z-index: 10;
  }

  .ehc-mini-player-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.15s ease;
  }

  .ehc-mini-player-btn:hover {
    background: rgba(0, 0, 0, 0.9);
  }

  .ehc-mini-player-info {
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, #1e293b 100%);
  }

  .ehc-mini-player-title {
    font-size: 14px;
    font-weight: 500;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ==========================================================================
     FLOATING CTA - DESKTOP ENHANCED
     ========================================================================== */
  .ehc-floating-cta {
    bottom: 28px;
    right: 28px;
  }

  .ehc-floating-cta a {
    padding: 14px 24px;
    font-size: 15px;
    gap: 10px;
    border-radius: 50px;
    box-shadow:
      0 8px 24px rgba(255, 0, 0, 0.3),
      0 0 0 1px rgba(255, 0, 0, 0.3);
  }

  .ehc-floating-cta a:hover {
    box-shadow:
      0 12px 32px rgba(255, 0, 0, 0.4),
      0 0 0 2px rgba(255, 0, 0, 0.5);
  }

  /* Notification badge */
  .ehc-floating-cta .ehc-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #22c55e;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    animation: pulse 2s infinite;
  }

  @keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
  }

  /* ==========================================================================
     KEYBOARD SHORTCUTS INDICATOR
     ========================================================================== */
  .ehc-keyboard-hints {
    position: fixed;
    bottom: 28px;
    left: 28px;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    z-index: 100;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
    pointer-events: none;
  }

  .ehc-keyboard-hints.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .ehc-keyboard-hints h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    margin: 0 0 12px;
  }

  .ehc-keyboard-hints ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .ehc-keyboard-hints li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    font-size: 13px;
    color: #e4e4e7;
  }

  .ehc-key {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 2px 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    min-width: 24px;
    text-align: center;
  }

  /* ==========================================================================
     WATCH LATER QUEUE
     ========================================================================== */
  .ehc-queue-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    height: 100vh;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
  }

  .ehc-queue-panel.open {
    transform: translateX(0);
  }

  .ehc-queue-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .ehc-queue-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #f8fafc;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .ehc-queue-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
  }

  .ehc-queue-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
  }

  .ehc-queue-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
  }

  .ehc-queue-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.15s ease;
    cursor: pointer;
  }

  .ehc-queue-item:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .ehc-queue-item-thumb {
    width: 120px;
    aspect-ratio: 16/9;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
  }

  .ehc-queue-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .ehc-queue-item-info {
    flex: 1;
    min-width: 0;
  }

  .ehc-queue-item-title {
    font-size: 13px;
    font-weight: 500;
    color: #f8fafc;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .ehc-queue-item-channel {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
  }

  /* ==========================================================================
     SMOOTH SCROLL BEHAVIOR
     ========================================================================== */
  html {
    scroll-behavior: smooth;
  }

  /* Section scroll snap (optional - can be enabled) */
  .ehc-homepage.snap-scroll {
    scroll-snap-type: y proximity;
  }

  .ehc-homepage.snap-scroll > .ehc-section {
    scroll-snap-align: start;
  }

  /* ==========================================================================
     REDUCED MOTION SUPPORT
     ========================================================================== */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }

    html {
      scroll-behavior: auto;
    }
  }
}

/* ==========================================================================
   LARGE DESKTOP (1400px+) - CINEMATIC MODE
   ========================================================================== */
@media screen and (min-width: 1400px) {
  .ehc-homepage {
    max-width: 1600px;
  }

  .ehc-hero {
    min-height: 90vh;
    padding: 120px 80px !important;
  }

  .ehc-hero h1 {
    font-size: 64px !important;
  }

  .ehc-hero p {
    font-size: 22px !important;
  }

  .ehc-featured-video .ehc-video-wrapper {
    border-radius: 20px !important;
  }

  .ehc-video-grid.ehc-cols-3 {
    gap: 36px;
  }

  .ehc-mini-player {
    width: 480px;
  }
}

/* ==========================================================================
   ULTRA-WIDE (2000px+) - EXPANDED LAYOUT
   ========================================================================== */
@media screen and (min-width: 2000px) {
  .ehc-homepage {
    max-width: 1920px;
  }

  .ehc-hero > .wp-block-columns {
    gap: 120px;
  }

  .ehc-hero h1 {
    font-size: 72px !important;
  }
}
