/* ===================================
   Games Like Minecraft - Main Styles
   =================================== */

/* CSS Variables */
:root {
    /* Minecraft Color Palette */
    --minecraft-green: #2D5A27;
    --minecraft-brown: #8B4513;
    --minecraft-blue: #4A90E2;
    --minecraft-light-green: #5CBB5C;
    --minecraft-dark-green: #1A3A1A;
    --minecraft-sand: #F5F5DC;
    --minecraft-stone: #7F7F7F;
    --minecraft-gold: #FFD700;
    
    /* UI Colors */
    --primary-color: var(--minecraft-green);
    --secondary-color: var(--minecraft-brown);
    --accent-color: var(--minecraft-blue);
    --success-color: var(--minecraft-light-green);
    --warning-color: var(--minecraft-gold);
    
    /* Background Colors */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-light: #f8f9fa;
    --bg-dark: #121212;
    
    /* Text Colors */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #ffffff;
    --text-muted: #999999;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
    --shadow-xl: 0 12px 24px rgba(0,0,0,0.25);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* ===================================
   Base Styles
   =================================== */

* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Pixel Font for Minecraft Style Text */
.pixel-font {
    font-family: 'Press Start 2P', monospace !important;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--minecraft-dark-green);
}

/* ===================================
   Loading Screen
   =================================== */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--minecraft-green), var(--minecraft-dark-green));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: var(--text-light);
}

.minecraft-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

.loading-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.loading-bar {
    width: 300px;
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress {
    height: 100%;
    background: var(--minecraft-gold);
    border-radius: var(--radius-sm);
    animation: loadingProgress 3s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes loadingProgress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* ===================================
   Header & Navigation
   =================================== */

.header {
    background: linear-gradient(135deg, var(--minecraft-green), var(--minecraft-dark-green));
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-light) !important;
    text-decoration: none;
    transition: transform var(--transition-fast);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.brand-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background: rgba(255,255,255,0.1);
    color: var(--text-light) !important;
    transform: translateY(-2px);
}

.navbar-toggler {
    border: none;
    color: var(--text-light);
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* ===================================
   Hero Section
   =================================== */

.hero-section {
    background: linear-gradient(135deg, var(--minecraft-green), var(--minecraft-blue));
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
    color: var(--text-light);
    text-align: center;
}

.minecraft-title {
    margin-bottom: 3rem;
}

.minecraft-title h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    margin: 0;
    text-shadow: 4px 4px 8px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

.title-word {
    display: inline-block;
    margin: 0 0.5rem;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

.title-word:nth-child(1) { animation-delay: 0s; }
.title-word:nth-child(2) { animation-delay: 0.5s; }
.title-word:nth-child(3) { animation-delay: 1s; }

@keyframes titleGlow {
    0% { text-shadow: 4px 4px 8px rgba(0,0,0,0.5); }
    100% { text-shadow: 4px 4px 8px rgba(0,0,0,0.5), 0 0 20px rgba(255,255,255,0.3); }
}

.welcome-text {
    margin-bottom: 3rem;
}

.welcome-text .lead {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.welcome-text .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    transition: transform var(--transition-fast);
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-item i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--minecraft-gold);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Press Start 2P', monospace;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Floating Blocks Animation */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.floating-blocks {
    position: relative;
    width: 100%;
    height: 100%;
}

.block {
    position: absolute;
    width: 40px;
    height: 40px;
    background: var(--minecraft-brown);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
}

.block-1 { top: 20%; left: 10%; animation-delay: 0s; }
.block-2 { top: 60%; left: 20%; animation-delay: 1s; background: var(--minecraft-stone); }
.block-3 { top: 30%; right: 15%; animation-delay: 2s; background: var(--minecraft-gold); }
.block-4 { top: 70%; right: 25%; animation-delay: 3s; }
.block-5 { top: 40%; left: 50%; animation-delay: 4s; background: var(--minecraft-blue); }

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(120deg); }
    66% { transform: translateY(10px) rotate(240deg); }
}

/* ===================================
   Search Section
   =================================== */

.search-section {
    padding: 3rem 0;
    background: var(--bg-light);
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-box .input-group {
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.search-box .input-group-text {
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    padding: 1rem;
}

.search-box .form-control {
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    background: white;
}

.search-box .form-control:focus {
    box-shadow: none;
    border-color: var(--primary-color);
}

.search-box .btn-primary {
    background: var(--accent-color);
    border: none;
    padding: 1rem 2rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.search-box .btn-primary:hover {
    background: var(--minecraft-blue);
    transform: translateY(-2px);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-suggestion-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.search-suggestion-item:hover {
    background: var(--bg-light);
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

/* Filter Section */
.filter-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-buttons .btn {
    border-radius: 25px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid #4a90e2;
    background: white;
    color: #4a90e2;
}

.filter-buttons .btn:hover {
    background: #4a90e2;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.filter-buttons .btn.active {
    background: #4a90e2;
    color: white;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.games-count {
    font-size: 16px;
    font-weight: 500;
}

/* Search Results */
.search-results-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: none;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.search-results-info i {
    color: #4a90e2;
}

/* Mobile responsiveness for filters */
@media (max-width: 768px) {
    .filter-section {
        padding: 15px;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .filter-buttons .btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .games-count {
        text-align: center;
        margin-top: 15px;
    }
}

/* ===================================
   Games Section
   =================================== */

.games-section {
    padding: 4rem 0;
    background: white;
}

.section-header {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    position: relative;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.games-count .badge {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
}

.filter-section {
    margin-bottom: 3rem;
}

.filter-section .btn-group .btn {
    padding: 0.75rem 1.5rem;
    margin: 0 0.25rem;
    border-radius: var(--radius-md) !important;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    transition: all var(--transition-fast);
}

.filter-section .btn-group .btn.active,
.filter-section .btn-group .btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-bottom: 3rem;
}

/* PacoGames-like item */
.itm.media-video.g-do {
    display: block;
    text-decoration: none;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    transition: all var(--transition-normal);
    overflow: hidden;
    position: relative;
    border: none;
    padding: 0;
    margin: 0;
}

.itm.media-video.g-do:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.c-products__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

.c-products__image {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
    border: none;
    padding: 0;
    margin: 0;
}

.c-products__image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    border: none;
    padding: 0;
    margin: 0;
}

/* Title overlay like screenshot */
.itm.media-video.g-do {
    position: relative;
}

.c-products__image:after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 50px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0));
}

.c-products__title {
    position: absolute;
    left: 0.5rem;
    bottom: 0.5rem;
    color: #fff;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
    background: rgba(0,0,0,0.7);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.game-card-play-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.game-card-play-btn:hover {
    background: var(--minecraft-blue);
    transform: scale(1.05);
}

.game-card-content {
    padding: 1.5rem;
}

.game-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.game-card-rating {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.rating-stars {
    color: var(--minecraft-gold);
    margin-right: 0.5rem;
}

.rating-value {
    font-weight: 600;
    color: var(--text-primary);
}

.game-card-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.feature-tag {
    background: var(--bg-light);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.game-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-play {
    background: linear-gradient(135deg, var(--success-color), var(--minecraft-light-green));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.btn-play:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.load-more-section {
    text-align: center;
    margin-top: 3rem;
}

#load-more-btn {
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    transition: all var(--transition-fast);
}

#load-more-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* ===================================
   About Section
   =================================== */

.about-section {
    padding: 4rem 0;
    background: var(--bg-light);
}

.about-content {
    text-align: center;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-item {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform var(--transition-fast);
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--minecraft-light-green));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 2rem;
}

.feature-item h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.feature-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===================================
   Footer
   =================================== */

.footer {
    background: linear-gradient(135deg, var(--minecraft-dark-green), var(--minecraft-green));
    color: var(--text-light);
    padding: 3rem 0 1rem;
    text-align: center;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.footer-links {
    margin-bottom: 2rem;
}

.footer-link {
    color: var(--text-light);
    text-decoration: none;
    margin: 0 1rem;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--minecraft-gold);
}

.separator {
    opacity: 0.5;
}

.footer-copyright {
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    opacity: 0.7;
}

/* ===================================
   Back to Top Button
   =================================== */

.btn-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.btn-back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.btn-back-to-top:hover {
    background: var(--minecraft-blue);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ===================================
   Image Optimization
   =================================== */

/* Remove any default image spacing and borders */
img {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Ensure game cards have no extra spacing */
.itm.media-video.g-do * {
    box-sizing: border-box;
}

/* Remove any browser default styling */
.c-products__image,
.c-products__image img {
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
}

/* Make container match image size exactly */
.itm.media-video.g-do {
    width: fit-content;
    max-width: 100%;
}

.c-products__image {
    display: inline-block;
    line-height: 0;
}

.c-products__image img {
    vertical-align: top;
    max-width: 100%;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
    .hero-section {
        padding: 4rem 0;
    }
    
    .minecraft-title h1 {
        font-size: 2rem;
    }
    
    .title-word {
        display: block;
        margin: 0.5rem 0;
    }
    
    .stats-row {
        gap: 1.5rem;
    }
    
    .stat-item {
        padding: 0.75rem;
        min-width: 120px;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.25rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .search-box .btn-primary {
        padding: 1rem;
    }
    
    .filter-section .btn-group {
        flex-wrap: wrap;
    }
    
    .filter-section .btn-group .btn {
        margin: 0.25rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .game-card-content {
        padding: 1rem;
    }
    
    .btn-back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}
