/**
 * SOK SOPHA PORTFOLIO - CORE STYLESHEET
 * Red & Blue Chasing Gradients, Glow Effects, and Custom Keyframes
 */

:root {
    --red-neon: #ff1e42;
    --red-warm: #ff4b2b;
    --blue-neon: #00d2ff;
    --blue-deep: #2563eb;
    --dark-bg: #05070f;
}

/* Base Body Styles */
body {
    background-color: var(--dark-bg);
    color: #f8fafc;
    overflow-x: hidden;
}

/* ==========================================================================
   ANIMATIONS & KEYFRAMES
   ========================================================================== */

/* Animated Red & Blue Chasing Gradient Keyframes */
@keyframes chaseGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Conic Gradient Border Rotation */
@keyframes rotateChase {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Ambient Neon Glow Pulsing */
@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.45;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.08);
    }
}

/* Floating Artboard Card Float */
@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-12px) rotate(1.5deg);
    }
}

/* ==========================================================================
   GRADIENT UTILITY CLASSES
   ========================================================================== */

/* Chasing Red & Blue Text Gradient */
.text-chase-gradient {
    background: linear-gradient(
        270deg,
        #ff1e42,
        #ff4b6e,
        #3b82f6,
        #00d2ff,
        #2563eb,
        #ff1e42
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: chaseGradient 5s ease infinite;
}

/* Chasing Red & Blue Background Fill */
.bg-chase-gradient {
    background: linear-gradient(
        135deg,
        #ff1e42 0%,
        #c81d77 35%,
        #2563eb 70%,
        #00d2ff 100%
    );
    background-size: 250% 250%;
    animation: chaseGradient 4s ease infinite;
}

/* Chasing Border Box with Rotating Conic Glow */
.chase-border-box {
    position: relative;
    border-radius: 1rem;
    z-index: 1;
    overflow: hidden;
}

.chase-border-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        #ff1e42,
        #ff5e3a,
        transparent 30%,
        #00d2ff,
        #2563eb,
        transparent 80%,
        #ff1e42
    );
    animation: rotateChase 4s linear infinite;
    z-index: -2;
}

.chase-border-box::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: #0a0f1f;
    border-radius: calc(1rem - 2px);
    z-index: -1;
    transition: background 0.3s ease;
}

.chase-border-box:hover::after {
    background: #0f162d;
}

/* Button with Chasing Glowing Border */
.btn-chase-outline {
    position: relative;
    z-index: 1;
    overflow: hidden;
    border-radius: 9999px;
    padding: 2px;
    background: linear-gradient(90deg, #ff1e42, #00d2ff, #2563eb, #ff1e42);
    background-size: 300% 100%;
    animation: chaseGradient 3.5s linear infinite;
    display: inline-block;
}

.btn-chase-outline-inner {
    background: #070b16;
    border-radius: 9999px;
    transition: all 0.3s ease;
}

.btn-chase-outline:hover .btn-chase-outline-inner {
    background: transparent;
}

/* ==========================================================================
   VISUAL PATTERNS & COMPONENTS
   ========================================================================== */

/* Subtle Designer Grid Overlay */
.bg-designer-grid {
    background-size: 40px 40px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

.floating-card {
    animation: floatSlow 6s ease-in-out infinite;
}

/* Skill Progress Bar Animation */
.skill-bar-fill {
    background: linear-gradient(90deg, #ff1e42 0%, #9333ea 50%, #00d2ff 100%);
    background-size: 200% 100%;
    animation: chaseGradient 3s linear infinite;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Portfolio Card Hover Effects */
.portfolio-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.portfolio-card:hover {
    transform: translateY(-8px);
    box-shadow: -10px 15px 35px -10px rgba(255, 30, 66, 0.35), 10px 15px 35px -10px rgba(0, 210, 255, 0.35);
}

/* 1:1 Square Card 3D Tilt & Dynamic Rotation Effect */
.card-3d-wrap {
    perspective: 1200px;
    transform-style: preserve-3d;
}

.card-3d-inner {
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
    transform-style: preserve-3d;
    will-change: transform;
    transform: perspective(1000px) rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg)) scale3d(1, 1, 1);
}

.card-3d-inner:hover {
    box-shadow: 0 25px 50px -12px rgba(255, 30, 66, 0.4), 0 0 30px -5px rgba(0, 210, 255, 0.45);
}

/* Subtle continuous rotation for badges & sparkles */
@keyframes continuousSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin-slow {
    animation: continuousSpin 12s linear infinite;
}

/* Rotating Conic Border Glow around 1:1 Cards */
.rotating-border-box {
    position: relative;
    border-radius: 1.25rem;
    overflow: hidden;
    z-index: 1;
}

.rotating-border-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        #ff1e42 0deg,
        #ff4b2b 45deg,
        transparent 90deg,
        #00d2ff 180deg,
        #2563eb 225deg,
        transparent 270deg,
        #ff1e42 360deg
    );
    animation: continuousSpin 4s linear infinite;
    z-index: -2;
    opacity: 0.75;
    transition: opacity 0.3s ease;
}

.rotating-border-box:hover::before {
    opacity: 1;
    animation-duration: 2.5s;
}

.rotating-border-box::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: #090d1a;
    border-radius: calc(1.25rem - 2px);
    z-index: -1;
}

/* 1:1 Square Image Hover Zoom & Rotation */
.photo-square-img {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

.group:hover .photo-square-img {
    transform: scale(1.08) rotate(1.5deg);
}

/* 3D Infinite Marquee Rotation Reel */
@keyframes marqueeScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.marquee-rotation-container {
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-rotation-track {
    display: flex;
    gap: 1.25rem;
    width: max-content;
    animation: marqueeScroll 35s linear infinite;
}

.marquee-rotation-container:hover .marquee-rotation-track {
    animation-play-state: paused;
}

/* Dynamic Specular Glare Effect */
.card-glare {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 50%), rgba(255, 255, 255, 0.22) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 10;
}

.card-3d-inner:hover .card-glare {
    opacity: 1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #05070f;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff1e42, #2563eb);
    border-radius: 9999px;
}

/* ==========================================================================
   HERO POSTER ROLLING SHOWCASE & POPUP
   ========================================================================== */
.hero-poster-viewport {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    aspect-ratio: 1 / 1;
    background-color: #05070f;
}

.hero-poster-track {
    display: flex;
    height: 100%;
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.hero-poster-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.hero-poster-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-poster-slide:hover img {
    transform: scale(1.06);
}

.hero-thumb-btn {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background-color: #090d1a;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.hero-thumb-btn:hover {
    border-color: rgba(255, 30, 66, 0.6);
    transform: translateY(-2px);
}

.hero-thumb-btn.active {
    border-color: #ff1e42;
    box-shadow: 0 0 16px rgba(255, 30, 66, 0.45);
    transform: translateY(-2px) scale(1.04);
}

.hero-thumb-btn.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 3px;
    border-radius: 9999px;
    background: #00d2ff;
}

@keyframes posterModalPop {
    0% {
        opacity: 0;
        transform: scale(0.92) translateY(18px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-poster-pop {
    animation: posterModalPop 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   PRINT MEDIA STYLES (Printable CV)
   ========================================================================== */
@media print {
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
    }
    header, footer, #toastBox, .fixed {
        display: none !important;
    }
    #projectModal {
        position: static !important;
        background: transparent !important;
        padding: 0 !important;
    }
    #projectModal .bg-dark-900 {
        background: #ffffff !important;
        color: #111827 !important;
        border: 1px solid #e5e7eb !important;
        box-shadow: none !important;
    }
}

/* ==========================================================================
   3D SOCIAL MEDIA ICONS
   ========================================================================== */
.social-3d-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.15rem;
    height: 3.15rem;
    border-radius: 1rem;
    color: #ffffff !important;
    font-size: 1.25rem;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease, filter 0.28s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.55);
    border-bottom: 2.5px solid rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
}

/* 3D Top Specular Gloss Highlight */
.social-3d-btn::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 2px;
    right: 2px;
    height: 46%;
    border-radius: 0.85rem 0.85rem 100% 100% / 0.85rem 0.85rem 60% 60%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.08) 100%);
    pointer-events: none;
    z-index: 1;
}

.social-3d-btn i {
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.social-3d-btn:hover {
    transform: translateY(-5px) scale(1.08);
    filter: brightness(1.12);
}

.social-3d-btn:hover i {
    transform: scale(1.15);
}

.social-3d-btn:active {
    transform: translateY(1px) scale(0.96);
    filter: brightness(0.95);
}

/* Platform-Specific 3D Gradients & Realistic Glow Shadows */
.social-3d-behance {
    background: linear-gradient(180deg, #1f75ff 0%, #0056f6 50%, #0036a3 100%);
    box-shadow: 0 10px 22px rgba(0, 86, 246, 0.5), 0 3px 6px rgba(0, 0, 0, 0.55), inset 0 1.5px 1px rgba(255, 255, 255, 0.65), inset 0 -2px 3px rgba(0, 0, 0, 0.4);
}
.social-3d-behance:hover {
    box-shadow: 0 14px 28px rgba(0, 86, 246, 0.65), 0 4px 8px rgba(0, 0, 0, 0.4), inset 0 1.5px 1px rgba(255, 255, 255, 0.75);
}

.social-3d-dribbble {
    background: linear-gradient(180deg, #ff65a5 0%, #ea4c89 50%, #b81b58 100%);
    box-shadow: 0 10px 22px rgba(234, 76, 137, 0.5), 0 3px 6px rgba(0, 0, 0, 0.55), inset 0 1.5px 1px rgba(255, 255, 255, 0.65), inset 0 -2px 3px rgba(0, 0, 0, 0.4);
}
.social-3d-dribbble:hover {
    box-shadow: 0 14px 28px rgba(234, 76, 137, 0.65), 0 4px 8px rgba(0, 0, 0, 0.4), inset 0 1.5px 1px rgba(255, 255, 255, 0.75);
}

.social-3d-telegram {
    background: linear-gradient(180deg, #3ec5ff 0%, #24a1de 50%, #1072a3 100%);
    box-shadow: 0 10px 22px rgba(36, 161, 222, 0.5), 0 3px 6px rgba(0, 0, 0, 0.55), inset 0 1.5px 1px rgba(255, 255, 255, 0.65), inset 0 -2px 3px rgba(0, 0, 0, 0.4);
}
.social-3d-telegram:hover {
    box-shadow: 0 14px 28px rgba(36, 161, 222, 0.65), 0 4px 8px rgba(0, 0, 0, 0.4), inset 0 1.5px 1px rgba(255, 255, 255, 0.75);
}

.social-3d-youtube {
    background: linear-gradient(180deg, #ff334b 0%, #ff0000 50%, #b80000 100%);
    box-shadow: 0 10px 22px rgba(255, 0, 0, 0.55), 0 3px 6px rgba(0, 0, 0, 0.55), inset 0 1.5px 1px rgba(255, 255, 255, 0.65), inset 0 -2px 3px rgba(0, 0, 0, 0.4);
}
.social-3d-youtube:hover {
    box-shadow: 0 14px 28px rgba(255, 0, 0, 0.75), 0 4px 8px rgba(0, 0, 0, 0.4), inset 0 1.5px 1px rgba(255, 255, 255, 0.75);
}

.social-3d-facebook {
    background: linear-gradient(180deg, #3e8ff8 0%, #1877f2 50%, #0d54b8 100%);
    box-shadow: 0 10px 22px rgba(24, 119, 242, 0.5), 0 3px 6px rgba(0, 0, 0, 0.55), inset 0 1.5px 1px rgba(255, 255, 255, 0.65), inset 0 -2px 3px rgba(0, 0, 0, 0.4);
}
.social-3d-facebook:hover {
    box-shadow: 0 14px 28px rgba(24, 119, 242, 0.65), 0 4px 8px rgba(0, 0, 0, 0.4), inset 0 1.5px 1px rgba(255, 255, 255, 0.75);
}

