/* Visual Effects for Public Site Only */

/* 1. Page Fade In */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

body {
    animation: fadeIn 0.6s ease-out;
}

/* 2. Video Card Hover Effects */
.video-card {
    transition: transform 0.1s steps(2), box-shadow 0.1s steps(2); /* Stepped transition for retro feel */
    box-shadow: 4px 4px 0px rgba(0,0,0,0.5);
    border: 2px solid var(--border-color);
}

.video-card:hover {
    /* transform: translateY(-5px) scale(1.02);  REMOVED: Handled by tilt.js */
    box-shadow: 8px 8px 0px rgba(84, 227, 88, 0.3); /* Green hard shadow */
    z-index: 10;
    border-color: var(--primary-color);
}

.video-card .thumbnail img {
    transition: transform 0.1s steps(2);
    image-rendering: pixelated;
}

.video-card:hover .thumbnail img {
    transform: scale(1.05);
}

/* 3. Button Glow & Hover */
.btn-primary, .btn-secondary {
    position: relative;
    overflow: hidden;
    transition: all 0.1s steps(2);
}

.btn-primary:hover {
    box-shadow: 4px 4px 0px rgba(0,0,0,0.5);
    transform: translate(-2px, -2px);
    border-color: #fff;
}

/* 4. Navbar Link Underline Animation */
.navbar .public-nav-links a {
    position: relative;
}

.navbar .public-nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.1s steps(4);
}

.navbar .public-nav-links a:hover::after {
    width: 100%;
}

/* 5. Input Field Glow */
input:focus, textarea:focus, select:focus {
    border-color: var(--primary-color);
    box-shadow: 4px 4px 0px rgba(84, 227, 88, 0.2); /* Hard shadow */
    outline: none;
}

/* 6. Status Card Pulse */
@keyframes pulse-border {
    0% { border-color: var(--primary-color); }
    50% { border-color: var(--secondary-color); }
    100% { border-color: var(--primary-color); }
}

.status-card.status-completed {
    animation: pulse-border 2s infinite steps(4);
}

/* 7. Search Bar Expand */
.search-container input {
    transition: width 0.3s steps(5), border-color 0.3s steps(2);
    border-radius: 0;
}

.search-container input:focus {
    width: 300px;
    border-color: var(--primary-color);
    box-shadow: 4px 4px 0px rgba(84, 227, 88, 0.3); /* Hard shadow */
    animation: search-pulse 2s infinite;
}

@keyframes search-pulse {
    0% { border-color: var(--primary-color); }
    50% { border-color: #E079FA; } /* Pulse to purple */
    100% { border-color: var(--primary-color); }
}

/* 8. Toast Notification Slide In */
.toast {
    animation: slideIn 0.3s steps(5) forwards;
    border: 2px solid #000;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.5);
    border-radius: 0;

    font-size: 0.7rem;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 9. Modal Fade In */
.modal {
    animation: fadeIn 0.3s steps(5);
}

.modal-content {
    animation: scaleUp 0.3s steps(5);
    border: 2px solid #000;
    box-shadow: 8px 8px 0px rgba(0,0,0,0.5);
    border-radius: 0;
}

@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* 10. Custom Cursor */
body.hide-cursor, 
body.hide-cursor a, 
body.hide-cursor button, 
body.hide-cursor input, 
body.hide-cursor textarea, 
body.hide-cursor select, 
body.hide-cursor .video-card, 
body.hide-cursor .status-card {
    cursor: none !important; /* Force hide default cursor only when script is active */
}

.custom-cursor {
    position: fixed;
    width: 10px; 
    height: 10px;
    background: #fff; 
    border-radius: 0; /* Square cursor */
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    box-shadow: 0 0 0 2px #000; /* Border */
    transition: none; /* Instant movement */
}

.custom-cursor-follower {
    display: none; /* Remove follower for cleaner pixel look */
}

.cursor-hover {
    background-color: var(--primary-color);
}

/* 11. Particle Canvas */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.4; /* Slightly more visible */
}

/* 12. Enderman Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000 !important; /* Force solid black */
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
    opacity: 1;
}

.enderman-container {
    position: relative;
    width: 200px;
    height: 400px; /* Taller container */
    display: flex;
    justify-content: center;
    align-items: center;
    /* border: 1px solid red; Debugging */
}

.enderman {
    position: relative;
    width: 60px;
    height: 250px;
    animation: bob 0.4s infinite alternate ease-in-out;
}

.head {
    width: 50px; /* Larger head */
    height: 50px;
    background: #161616;
    position: absolute;
    top: 0;
    left: 5px;
    box-shadow: inset 0 0 0 4px #000;
    z-index: 10;
}

.eyes {
    width: 14px;
    height: 4px;
    background: #E079FA;
    position: absolute;
    top: 25px;
    left: 0;
    box-shadow: 36px 0 0 #E079FA; /* Adjusted for wider head */
    animation: blink 4s infinite;
}

.body {
    width: 30px;
    height: 80px; /* Longer body */
    background: #161616;
    position: absolute;
    top: 50px; /* Connected to head */
    left: 15px;
    box-shadow: inset 0 0 0 4px #000;
    z-index: 5;
}

.arm-left, .arm-right {
    width: 8px;
    height: 140px; /* Longer arms */
    background: #161616;
    position: absolute;
    top: 50px; /* Connected to shoulder */
    transform-origin: top center;
    box-shadow: inset 0 0 0 2px #000;
}

/* Arms holding block pose to the right (Side Profile) */
.arm-left {
    left: 10px;
    transform: rotate(-40deg);
    z-index: 10;
}

.arm-right {
    right: 10px;
    transform: rotate(-40deg);
    z-index: 9; /* Slightly behind left arm */
}

.leg-left, .leg-right {
    width: 8px;
    height: 130px; /* Longer legs */
    background: #161616;
    position: absolute;
    top: 120px; /* Connected to bottom of body */
    transform-origin: top center;
    box-shadow: inset 0 0 0 2px #000;
}

.leg-left {
    left: 20px;
    animation: run-left 0.4s infinite linear;
}

.leg-right {
    right: 20px;
    animation: run-right 0.4s infinite linear;
}

/* Grass Block held in hands */
.grass-block {
    width: 60px; /* Larger block */
    height: 60px;
    position: absolute;
    top: 110px; /* Adjusted to meet hands */
    left: -15px; /* Moved left to meet hands */
    transform: rotate(-40deg); /* Match arm angle */
    box-shadow: 6px 6px 0px rgba(0,0,0,0.5);
    z-index: 12; /* Held by front arm */
    animation: block-bob 0.4s infinite alternate ease-in-out;
}

.grass-top {
    width: 100%;
    height: 20px;
    background: #54E358;
    border: 4px solid #000;
    border-bottom: none;
    box-sizing: border-box;
}

.dirt-side {
    width: 100%;
    height: 40px;
    background: #795548;
    border: 4px solid #000;
    border-top: none;
    background-image: linear-gradient(#54E358 8px, transparent 8px);
    box-sizing: border-box;
}

.loading-text {
    position: absolute;
    bottom: 20px; /* Fixed at bottom */

    color: #fff;
    font-size: 1.5rem;
    animation: pulse 1s infinite;
    text-shadow: 4px 4px 0px #000;
    letter-spacing: 4px;
    text-align: center;
    width: 100%;
}

/* Enderman Particles */
.enderman::before {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: #E079FA;
    box-shadow: 
        10px -20px 0 #E079FA,
        -15px 10px 0 #E079FA,
        20px 30px 0 #E079FA,
        -10px 50px 0 #E079FA,
        15px 80px 0 #E079FA;
    animation: particles 2s infinite linear;
    opacity: 0;
    z-index: 20;
}

@keyframes particles {
    0% { opacity: 0; transform: translateY(0); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-50px); }
}

/* Animations */
@keyframes bob {
    from { transform: translateY(0); }
    to { transform: translateY(-5px); }
}

@keyframes block-bob {
    from { transform: translateY(0); }
    to { transform: translateY(-5px); }
}

@keyframes run-left {
    0% { transform: rotate(25deg); }
    50% { transform: rotate(-25deg); }
    100% { transform: rotate(25deg); }
}

@keyframes run-right {
    0% { transform: rotate(-25deg); }
    50% { transform: rotate(25deg); }
    100% { transform: rotate(-25deg); }
}

@keyframes blink {
    0%, 90%, 100% { height: 4px; top: 25px; }
    95% { height: 1px; top: 27px; }
}

.page-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* 13. Logo Effects */
.logo {
    color: #54E358; /* Minecraft Green */
    text-shadow: 4px 4px 0px #000; /* Hard black shadow */
    transition: all 0.1s steps(2);
    letter-spacing: 2px;
    text-decoration: none !important;
    border-bottom: none !important;

    font-size: 2rem; /* Larger size */
    text-transform: uppercase;
}

.logo:hover {
    text-shadow: 6px 6px 0px #000;
    transform: scale(1.05);
    color: #6AFF6E; /* Brighter green on hover */
}

/* 14. Upcoming Deadlines Scrollbar */
.upcoming-deadlines-list::-webkit-scrollbar {
    width: 10px;
}

.upcoming-deadlines-list::-webkit-scrollbar-track {
    background: #2c2c2c;
    border-left: 2px solid #000;
}

.upcoming-deadlines-list::-webkit-scrollbar-thumb {
    background: #585858;
    border: 2px solid #000;
    box-shadow: inset -2px -2px 0px rgba(0,0,0,0.5), inset 2px 2px 0px rgba(255,255,255,0.2);
}

.upcoming-deadlines-list::-webkit-scrollbar-thumb:hover {
    background: #777;
}
/* 15. Trending Cards (Diamond Theme) */
.featured-slider .video-card {
    /* Remove old border method */
    border: none;
    background: var(--card-bg);
    
    /* Stronger Glow */
    box-shadow: 0 0 15px rgba(85, 255, 255, 0.2);
    
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

/* Gradient Border using Mask */
.featured-slider .video-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px; 
    padding: 2px; /* Border width */
    background: linear-gradient(135deg, #55FFFF 0%, #00AAAA 50%, #55FFFF 100%); 
    -webkit-mask: 
       linear-gradient(#fff 0 0) content-box, 
       linear-gradient(#fff 0 0);
    mask: 
       linear-gradient(#fff 0 0) content-box, 
       linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 5; /* On top of content */
}

.featured-slider .video-card:hover {
    /* Brighter Glow on Hover */
    box-shadow: 0 0 25px rgba(85, 255, 255, 0.5), 0 0 50px rgba(85, 255, 255, 0.2);
    transform: translateY(-8px) scale(1.03);
    z-index: 15;
}

.featured-slider .video-card::after {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(
        115deg,
        rgba(255, 255, 255, 0) 30%,
        rgba(255, 255, 255, 0.1) 45%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0.1) 55%,
        rgba(255, 255, 255, 0) 70%
    );
    transform: rotate(25deg);
    animation: shimmer 5s infinite linear;
    pointer-events: none;
    z-index: 20;
    /* Removed mix-blend-mode to avoid artifacts */
}

/* Taller cards for Featured Slider */
.featured-slider .video-card .thumbnail {
    padding-top: 56.25%; /* Standard 16:9 Aspect Ratio */
}

/* Inner Glow Overlay */
.diamond-overlay {
    position: absolute;
    inset: 0;
    z-index: 4; /* Above image (0), below border (5) */
    pointer-events: none;
    transition: box-shadow 0.3s ease;
}

.featured-slider .video-card:hover .diamond-overlay {
    box-shadow: inset 0 0 30px rgba(85, 255, 255, 0.4), inset 0 0 10px rgba(85, 255, 255, 0.2);
}

@keyframes shimmer {
    0% { transform: translate(-30%, -30%) rotate(25deg); }
    100% { transform: translate(20%, 20%) rotate(25deg); }
}


/* 17. Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #1D1D1D; /* Dark background */
    border-left: 2px solid #000;
}

::-webkit-scrollbar-thumb {
    background: #54E358; /* Minecraft Green */
    border: 2px solid #000; /* Pixel border */
    box-shadow: inset -2px -2px 0px rgba(0,0,0,0.5), inset 2px 2px 0px rgba(255,255,255,0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: #3C8527; /* Darker Green */
}
