/* =========================================================================
   VIDEO EDITING PORTFOLIO SPECIFIC STYLES
   Theme Colors: #001122, #0A0F14, Cyan Blues, White
   ========================================================================= */

:root {
  --x-deep-bg: #001122;
  --x-neutral-bg: #0A0F14;
  --x-cyan-1: #004b73;
  --x-cyan-2: #0073a8;
  --x-cyan-3: #00b4eb;
  --x-cyan-light: #00e5ff;
  
  --x-grey: #78787D;
  --x-grey-light: #C8C8CD;
  --x-white: #FFFFFF;
  
  --x-glass-bg: rgba(255, 255, 255, 0.03);
  --x-glass-border: rgba(255, 255, 255, 0.08);
}

html { overflow-x: hidden; max-width: 100%; }
body.x-theme {
  background: var(--x-neutral-bg);
  background-image: radial-gradient(circle at top right, rgba(0, 75, 115, 0.1), transparent 50%),
                    radial-gradient(circle at bottom left, rgba(0, 17, 34, 1), transparent 80%);
  color: var(--x-white);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  max-width: 100%;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Outfit', sans-serif; font-weight: 500; line-height: 1.2; }
a { text-decoration: none; color: inherit; }

.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mt-4 { margin-top: 4rem; }
.mb-1 { margin-bottom: 1rem; }

/* Custom Cursor */
.cursor-glow { display: none; transition: opacity 0.3s ease; }
@media (min-width: 900px) {
  .cursor-glow {
    display: block; position: fixed; top: 0; left: 0;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(0, 115, 168, 0.15) 0%, rgba(0, 229, 255, 0.05) 30%, rgba(0,0,0,0) 70%);
    border-radius: 50%; pointer-events: none;
    transform: translate(-50%, -50%); z-index: 9999;
    mix-blend-mode: screen;
  }
  
  /* Hide cursor glow when hovering over cards so the cyan glow doesn't block the preview */
  body:has(.x-card:hover) .cursor-glow {
    opacity: 0;
  }
}

/* Scroll Progress */
.x-progress-bar {
  position: fixed; top: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--x-cyan-1), var(--x-cyan-3));
  width: 0%; z-index: 10000;
  box-shadow: 0 0 10px rgba(0, 180, 235, 0.4);
}

/* Nav */
.x-navbar {
  position: fixed; top: 0; width: 100%; padding: 1.5rem 5%; z-index: 1000; transition: all 0.3s ease; border-bottom: 1px solid transparent;
}
.x-navbar.scrolled {
  background: rgba(10, 15, 20, 0.85); backdrop-filter: blur(15px); border-bottom: 1px solid var(--x-glass-border); padding: 1rem 5%;
}
.x-back-link {
  color: var(--x-white); font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 400; display: inline-flex; align-items: center; gap: 0.5rem; transition: color 0.3s;
}
.x-back-link:hover { color: var(--x-cyan-3); }

/* Layout Grid */
.container { width: 90%; max-width: 1200px; margin: 0 auto; }
.x-section { padding: 6rem 0; position: relative; }

/* Desktop Grid System */
.x-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 600px) { .x-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .x-grid { grid-template-columns: repeat(3, 1fr); gap: 3rem; } }

/* Hero */
.x-hero { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; padding-top: 100px; }
.x-hero-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: linear-gradient(180deg, rgba(0, 17, 34, 0.8) 0%, rgba(10, 15, 20, 1) 100%); }
.x-gradient-blob { position: absolute; border-radius: 50%; filter: blur(140px); opacity: 0.4; }
.x-blob-1 { width: 60vw; height: 60vw; background: var(--x-cyan-1); top: -20%; right: -10%; animation: pulse 12s infinite alternate; }
.x-blob-2 { width: 40vw; height: 40vw; background: var(--x-cyan-2); left: -10%; bottom: 0%; animation: pulse 10s infinite alternate-reverse; opacity: 0.2;}
@keyframes pulse { 0% { transform: scale(1); } 100% { transform: scale(1.1); } }

.x-hero-inner { position: relative; z-index: 1; }
.x-badge { display: inline-block; padding: 0.5rem 1.2rem; background: rgba(0, 180, 235, 0.1); border: 1px solid rgba(0, 180, 235, 0.3); border-radius: 30px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 2px; color: var(--x-cyan-3); }
.x-hero-title { font-size: clamp(2.5rem, 5vw, 4.5rem); margin-bottom: 1.5rem; letter-spacing: -1px; }
.x-hero-lead { color: var(--x-grey-light); font-size: 1.2rem; font-weight: 300; }
.x-disclaimer { font-family: monospace; font-size: 0.8rem; color: var(--x-grey); max-width: 600px; margin: 0 auto; line-height: 1.5; padding: 1rem; border-top: 1px solid var(--x-glass-border); border-bottom: 1px solid var(--x-glass-border);}

/* Filtering System */
.x-filter-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-bottom: 2rem; position: relative; z-index: 2;}
.x-filter-btn { background: var(--x-glass-bg); border: 1px solid var(--x-glass-border); color: var(--x-grey-light); padding: 0.6rem 1.5rem; border-radius: 30px; cursor: pointer; transition: all 0.3s; font-family: 'Outfit'; font-size: 0.95rem; }
.x-filter-btn:hover { background: rgba(255,255,255,0.1); color: var(--x-white); }
.x-filter-btn.active { background: var(--x-cyan-1); border-color: var(--x-cyan-3); color: var(--x-white); box-shadow: 0 0 15px rgba(0, 115, 168, 0.4); }

/* Card Design */
.x-card { display: block; background: var(--x-glass-bg); border: 1px solid var(--x-glass-border); border-radius: 16px; overflow: hidden; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); position: relative; }
.x-card-thumb { position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; background: #000; border-bottom: 1px solid var(--x-glass-border);}
.x-card-thumb img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.7) contrast(1.1); transition: transform 0.6s ease; }
.x-hover-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4); display: flex; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.4s ease; backdrop-filter: blur(1px); pointer-events: none; }
.x-hover-overlay span { border: 1px solid var(--x-white); padding: 0.6rem 1.5rem; border-radius: 30px; font-weight: 500; font-size: 0.9rem; transform: translateY(10px); transition: transform 0.4s ease; pointer-events: auto; cursor: pointer; }

.x-card-content { padding: 1.8rem; }
.x-tag { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2px; color: var(--x-cyan-3); font-weight: 600; margin-bottom: 0.8rem; display: inline-block; }
.x-card h3 { font-size: 1.25rem; margin-bottom: 1rem; color: var(--x-white); line-height: 1.4; transition: color 0.3s;}

/* Internal Feedback Design */
.x-feedback-section { background: rgba(0,0,0,0.3); padding: 1rem; border-radius: 8px; border-left: 3px solid var(--x-cyan-2); margin-top: 1rem;}
.x-feedback-section strong { display: block; font-size: 0.8rem; color: var(--x-grey-light); margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 1px; font-family: 'Outfit';}
.x-feedback-section p { font-size: 0.9rem; color: var(--x-grey); line-height: 1.5; margin: 0; }

.x-card:hover { transform: translateY(-8px); border-color: rgba(0, 180, 235, 0.4); box-shadow: 0 15px 40px rgba(0,0,0,0.6), 0 0 20px rgba(0, 75, 115, 0.2); }
.x-card:hover .x-card-thumb img { transform: scale(1.05); }
.x-card:hover .x-hover-overlay { opacity: 1; }
.x-card:hover .x-hover-overlay span { transform: translateY(0); }
.x-card:hover h3 { color: var(--x-cyan-light); }

/* Figma Section */
.x-figma-banner { background: linear-gradient(135deg, rgba(0, 17, 34, 0.8), rgba(0, 75, 115, 0.2)); border: 1px solid rgba(0, 180, 235, 0.3); border-radius: 20px; padding: 4rem; display: flex; align-items: center; justify-content: space-between; gap: 4rem; flex-wrap: wrap; position: relative; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.5);}
.x-figma-banner::before { content: ''; position: absolute; right: 0; top: 0; width: 400px; height: 400px; background: radial-gradient(circle, rgba(0, 229, 255, 0.1) 0%, transparent 60%); pointer-events: none;}
.x-banner-content { flex: 1; min-width: 300px; z-index: 1;}
.x-banner-content h2 { font-size: 2.5rem; margin-bottom: 1rem; }
.x-banner-content p { color: var(--x-grey-light); font-size: 1.1rem; line-height: 1.6; margin-bottom: 2rem; max-width: 600px;}
.x-framework-list { display: grid; grid-template-columns: 1fr; gap: 0.8rem; list-style: none; padding: 0; margin-bottom: 2rem; }
@media (min-width: 600px) { .x-framework-list { grid-template-columns: 1fr 1fr; } }
.x-framework-list li { display: flex; align-items: center; gap: 0.8rem; color: var(--x-grey-light); font-size: 0.95rem; }
.x-framework-list span { color: var(--x-cyan-3); font-size: 0.8rem; }

.x-btn-premium { display: inline-block; padding: 1rem 2.5rem; background: linear-gradient(90deg, var(--x-cyan-1), var(--x-cyan-2)); color: white; font-weight: 600; font-family: 'Outfit'; border-radius: 30px; transition: all 0.3s; box-shadow: 0 10px 20px rgba(0, 75, 115, 0.3); border: 1px solid rgba(255,255,255,0.1);}
.x-btn-premium:hover { box-shadow: 0 15px 30px rgba(0, 180, 235, 0.4); transform: translateY(-3px); }

.x-banner-visual { flex: 0.5; display: flex; justify-content: center; align-items: center; min-width: 250px; z-index: 1;}
.figma-icon { width: 150px; height: 150px; border-radius: 40px; background: rgba(0,0,0,0.5); border: 2px solid var(--x-cyan-3); display: flex; align-items: center; justify-content: center; font-family: 'Outfit'; font-weight: 700; font-size: 1.2rem; color: var(--x-cyan-light); box-shadow: inset 0 0 40px rgba(0, 75, 115, 0.5), 0 20px 40px rgba(0,0,0,0.5); transform: rotate(10deg); transition: transform 0.5s;}
.x-figma-banner:hover .figma-icon { transform: rotate(0deg) scale(1.05); }

/* Footer */
.x-footer { border-top: 1px solid var(--x-glass-border); padding: 3rem 0; color: var(--x-grey); font-size: 0.85rem; font-family: monospace; }

/* GSAP Init */
.fade-up { opacity: 0; transform: translateY(40px); }

/* =========================================================================
   LIGHTBOX STYLES
   ========================================================================= */
.x-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, backdrop-filter 0.4s ease;
  /* Glassy Effect instead of just dark background */
  background: rgba(0, 17, 34, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.x-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.x-lightbox-close {
  position: absolute;
  top: 30px;
  right: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--x-glass-border);
  color: var(--x-white);
  font-size: 1.5rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  z-index: 2;
}

@media (max-width: 900px) {
  .x-lightbox-close {
    top: 20px;
    right: 20px;
  }
}

@media (max-width: 600px) {
  .x-lightbox-close {
    top: 15px;
    right: 15px;
  }
}

.x-lightbox-close:hover {
  background: var(--x-cyan-1);
  transform: scale(1.1);
}

.x-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--x-glass-border);
  color: var(--x-white);
  font-size: 1.5rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  z-index: 2;
}

.x-lightbox-nav:hover {
  background: var(--x-cyan-1);
  transform: translateY(-50%) scale(1.1);
}

.x-lightbox-nav.prev { left: 40px; }
.x-lightbox-nav.next { right: 40px; }

.x-lightbox-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.x-lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideFadeIn 0.5s ease;
}

.x-lightbox-counter {
  margin-top: 15px;
  font-family: 'Outfit';
  font-size: 1rem;
  letter-spacing: 2px;
  color: var(--x-white);
  background: rgba(0,0,0,0.5);
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  backdrop-filter: blur(5px);
}

@keyframes slideFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hide glowing cursor when lightbox is active */
body.lightbox-open .cursor-glow {
  opacity: 0 !important;
  display: none !important;
}

/* =========================================================================
   CUSTOM VIDEO PLAYER UI
   ========================================================================= */
#youtubePlayer, #vimeoPlayer {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 16/9 !important;
    height: auto !important;
    pointer-events: none !important;
    border-radius: 12px;
    background: #000;
}

#youtubePlayer iframe, #vimeoPlayer iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    border-radius: 12px;
}

.x-video-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    background: #000;
    width: 100%;
    max-width: 95vw;
    max-height: 95vh;
    min-width: min(340px, 95vw);
}

.x-video-wrapper video {
    display: block;
    box-shadow: none !important;
    width: 100%;
    max-height: calc(95vh - 90px);
    object-fit: contain;
}

@media (min-width: 900px) {
    .x-video-wrapper {
        max-width: min(1200px, 90vw, calc((90vh - 100px) * 16 / 9));
        aspect-ratio: 16/9;
        display: block;
    }
    #youtubePlayer, #vimeoPlayer {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        aspect-ratio: none !important;
    }
    .x-video-wrapper video {
        max-height: 85vh;
    }
}

.custom-video-controls {
    /* Mobile base styles: positioned below video */
    position: relative;
    background: rgba(10, 15, 20, 0.95);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 1; /* Always visible on mobile */
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

@media (min-width: 900px) {
    .custom-video-controls {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
        padding: 30px 15px 15px;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .x-video-wrapper:hover .custom-video-controls,
    .custom-video-controls.active {
        opacity: 1;
    }
}

/* Progress Bar */
.video-progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: height 0.2s;
}
.video-progress-container:hover {
    height: 8px;
}

.video-progress-bar {
    height: 100%;
    background: var(--x-cyan-3);
    width: 0%;
    border-radius: 3px;
    position: absolute;
    top: 0;
    left: 0;
    box-shadow: 0 0 10px rgba(0, 180, 235, 0.5);
    pointer-events: none;
}

.video-controls-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.video-controls-left, .video-controls-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-btn {
    background: none;
    border: none;
    color: var(--x-white);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: color 0.2s, transform 0.2s;
}

.control-btn:hover {
    color: var(--x-cyan-3);
    transform: scale(1.1);
}

.video-time {
    color: var(--x-white);
    font-size: 0.85rem;
    font-family: monospace;
    letter-spacing: 1px;
    user-select: none;
    white-space: nowrap;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 60px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.3);
    height: 4px;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: width 0.3s ease;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--x-cyan-3);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/* Settings Menu */
.settings-menu {
    position: absolute;
    bottom: 45px;
    right: -10px;
    background: rgba(10, 15, 20, 0.95);
    border: 1px solid var(--x-glass-border);
    border-radius: 8px;
    width: 120px;
    display: none;
    flex-direction: column;
    padding: 8px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    z-index: 100;
}
.settings-menu.active {
    display: flex;
}
.settings-header {
    padding: 5px 15px;
    font-size: 0.75rem;
    color: var(--x-grey);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 5px;
    font-family: 'Outfit';
    text-transform: uppercase;
}
.settings-option {
    padding: 8px 15px;
    color: var(--x-white);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}
.settings-option:hover {
    background: rgba(0, 180, 235, 0.2);
}
.settings-option.active {
    color: var(--x-cyan-3);
}

/* Fullscreen handling */
:fullscreen .x-video-wrapper {
    max-width: 100vw;
    max-height: 100vh;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}
:fullscreen #lightboxVideo {
    max-width: 100vw !important;
    max-height: 100vh !important;
    width: auto;
    height: 100vh;
    border-radius: 0 !important;
    margin: 0 auto;
}
:fullscreen .custom-video-controls {
    border-radius: 0;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 30px 15px 15px;
    opacity: 1;
}
