/*
    Diegetic Digital Frontier - Enhanced Phase 2 CSS
    Added: Dark Mode Toggle, Better Animations, Search Functionality, Social Links
*/

/* 1. Core Setup & Font Stack */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Roboto:wght@400;700&display=swap');

:root {
    --primary-bg: #333;
    --primary-text: #FFFFFF;
    --window-bg: rgba(198, 198, 198, 0.8);
    --window-text: #000000;
    --slot-bg: rgba(139, 139, 139, 0.8);
    --border-light: #FFFFFF;
    --border-dark: #373737;
}

body.dark-mode {
    --primary-bg: #1a1a1a;
    --window-bg: rgba(50, 50, 50, 0.9);
    --window-text: #FFFFFF;
    --slot-bg: rgba(80, 80, 80, 0.9);
}

body {
    background-color: var(--primary-bg);
    color: var(--primary-text);
    font-family: 'Roboto', sans-serif;
    image-rendering: pixelated;
    cursor: url('https://cur.cursors-4u.net/games/gam-15/gam1401.cur'), auto;
    transition: background-color 0.3s ease;
}

.background-blur {
    position: fixed;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background-image: url('https://i.redd.it/pp6lcb2wir941.png');
    background-size: cover;
    background-position: center;
    filter: blur(8px);
    z-index: -1;
    transition: filter 0.3s ease;
}

body.dark-mode .background-blur {
    filter: blur(12px) brightness(0.6);
}

h1, h2, h3, h4, h5, h6, .font-minecraft {
    font-family: 'Press Start 2P', cursive;
}

/* 2. Minecraft GUI Window & Component Styling */
.mc-window {
    background-color: var(--window-bg);
    border-style: solid;
    border-width: 2px;
    border-color: var(--border-light) var(--border-dark) var(--border-dark) var(--border-light);
    box-shadow: inset 2px 2px 0px var(--border-light), inset -2px -2px 0px #5A5A5A;
    padding: 1rem;
    color: var(--window-text);
    backdrop-filter: blur(2px);
    animation: slideIn 0.5s ease-out;
}

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

.mc-slot {
    background-color: var(--slot-bg);
    border: 2px solid var(--border-dark);
    box-shadow: inset 2px 2px 0px var(--border-light), inset -2px -2px 0px #5A5A5A;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    position: relative;
    backdrop-filter: blur(2px);
    transition: all 0.1s ease-out;
    flex-shrink: 0;
}

.mc-slot:hover {
    transform: translateY(-4px) scale(1.05);
}

.mc-slot:active {
    transform: translateY(0px) scale(0.95);
}

.mc-slot img {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
}

/* Video Card Improvements - NEW */
.video-card {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.video-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

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

.video-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.3s ease-in-out;
    z-index: 2;
}

.video-card:hover::before {
    background-color: rgba(0, 0, 0, 0.5);
}

.video-card::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: rgba(255, 255, 255, 0);
    transition: color 0.3s ease-in-out;
    z-index: 3;
}

.video-card:hover::after {
    color: rgba(255, 255, 255, 0.9);
}

.mc-button {
    background-color: #707070;
    border-style: solid;
    border-width: 2px;
    border-color: var(--border-light) var(--border-dark) var(--border-dark) var(--border-light);
    color: white;
    padding: 10px 20px;
    text-shadow: 2px 2px #333333;
    display: inline-block;
    text-align: center;
    transition: all 0.1s ease-out;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
}

.mc-button:hover, .mc-button:focus {
    background-color: #A0A0A0;
    transform: scale(1.05);
}

.mc-button:active {
    transform: scale(0.95);
}

/* Dark Mode Toggle Button - NEW */
.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 200;
    background-color: rgba(112, 112, 112, 0.9);
    border: 2px solid var(--border-dark);
    width: 50px;
    height: 50px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    padding: 0;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.4);
}

.dark-mode-toggle:active {
    transform: scale(0.95);
}

/* Search & Filter Section - NEW */
.search-container {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input {
    padding: 10px 15px;
    border: 2px solid var(--border-dark);
    background-color: rgba(100, 100, 100, 0.7);
    color: var(--primary-text);
    font-family: 'Roboto', sans-serif;
    border-radius: 4px;
    flex: 1;
    min-width: 200px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    background-color: rgba(120, 120, 120, 0.9);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Social Links - NEW */
.social-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.social-link {
    width: 40px;
    height: 40px;
    background-color: var(--slot-bg);
    border: 2px solid var(--border-dark);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--primary-text);
    transition: all 0.2s ease;
    font-size: 20px;
}

.social-link:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 3. Hotbar Navigation System */
.hotbar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    z-index: 100;
    width: auto;
    max-width: 90vw;
}

.hotbar .mc-slot.active {
    border-color: var(--border-light);
    box-shadow: 0 0 5px 2px var(--border-light), inset 2px 2px 0px var(--border-light), inset -2px -2px 0px #5A5A5A;
}

.hotbar .mc-slot .hotbar-key {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 10px;
    color: #FFF;
    text-shadow: 1px 1px #000;
}

.hotbar .mc-slot .tooltip {
    visibility: hidden;
    width: 160px;
    background-color: #100010;
    color: #fff;
    text-align: center;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -80px;
    opacity: 0;
    transition: opacity 0.3s;
    border: 2px solid #5000FF;
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
}

.hotbar .mc-slot:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* 4. Particle Click Effect */
.particle {
    position: fixed;
    width: 8px;
    height: 8px;
    background-color: #FFF;
    border: 1px solid #999;
    pointer-events: none;
    z-index: 9999;
    animation: fade-out 1s forwards;
    image-rendering: pixelated;
}

@keyframes fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* 5. Mobile Optimization */
@media (max-width: 768px) {
    .hotbar {
        left: 0;
        right: 0;
        transform: none;
        padding: 0 10px;
        justify-content: flex-start;
        overflow-x: auto;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .hotbar::-webkit-scrollbar {
        display: none;
    }

    .mc-window {
        padding: 0.5rem;
    }

    h1, h2, h3, .font-minecraft {
        font-size: 0.8rem;
    }

    .dark-mode-toggle {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .search-container {
        flex-direction: column;
    }

    .search-input {
        min-width: 100%;
    }

    .social-links {
        gap: 10px;
    }
}
