@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    --bg-dark: #181818;
    --bg-darker: #1f1f1f;
    --accent: #ffcc00;
    --text-light: #ffffff;
    --text-gray: #a0a0a0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    contain: layout style;
    position: relative;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    contain: layout;
}

@media (max-width: 1200px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* CRITICAL ABOVE THE FOLD STYLES */
.header {
    background-color: var(--bg-darker);
    border-bottom: 2px solid var(--accent);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(255, 204, 0, 0.1);
    contain: layout style paint;
    width: 100%;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 20px;
    position: relative;
    width: 100%;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    transform: scale(1.1);
    color: var(--accent);
}

/* Mobile responsive menu */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: none !important;
    }

    /* Hide header nav links on mobile - use bottom nav instead */
    .nav-links {
        display: none !important;
    }
}

.hero {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    max-width: 100%;
    margin: 0 auto;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
    }
}

.search-input {
    flex: 1;
    padding: 0.8rem;
    background: var(--bg-darker);
    border: 1px solid #444;
    border-radius: 5px;
    color: var(--text-light);
    font-size: 1rem;
}

.search-button {
    padding: 0.8rem 1.5rem;
    background: var(--accent);
    color: var(--bg-dark);
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-button:hover {
    background: #ffb700;
}

/* Tutorials Grid */
.tutorials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    width: 100%;
}

@media (max-width: 1024px) {
    .tutorials-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .tutorials-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .tutorials-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.tutorial-card {
    background: var(--bg-darker);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    contain: layout style paint;
}

.tutorial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 204, 0, 0.2);
}

.tutorial-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.tutorial-content {
    padding: 1.5rem;
}

.tutorial-category {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.tutorial-title {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.tutorial-title a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.tutorial-title a:hover {
    color: var(--accent);
}

.tutorial-excerpt {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.read-more {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.read-more:hover {
    gap: 0.5rem;
    color: #ffb700;
}

.read-more span {
    transition: transform 0.3s ease;
    display: inline-block;
    margin-left: 0.25rem;
}

.read-more:hover span {
    transform: translateX(3px);
}

/* Footer */
.footer {
    background: var(--bg-darker);
    border-top: 2px solid var(--accent);
    margin-top: 4rem;
    padding: 3rem 0 1rem;
}

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

.footer-section h3 {
    color: var(--accent);
    margin-bottom: 1rem;
}

.footer-section p {
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.5rem;
    background: var(--bg-dark);
    border: 1px solid #444;
    border-radius: 5px;
    color: var(--text-light);
}

.newsletter-form button {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: var(--bg-dark);
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 1rem;
    text-align: center;
    color: var(--text-gray);
    font-size: 0.9rem;
}

.footer-bottom-links {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-bottom-links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-bottom-links a:hover {
    color: var(--accent);
}
/* Mobile Menu */
/* These styles are now in the main nav section above */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.75rem;
    }

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

    .tutorials-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* Header & Navigation */
.header {
    background-color: var(--bg-darker);
    border-bottom: 2px solid var(--accent);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(255, 204, 0, 0.1);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent);
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo:hover {
    text-shadow: 0 0 20px var(--accent);
}



/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--accent), #ffdd44);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Tutorial Grid */
.tutorials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 3rem 0;
}

.tutorial-card {
    background: var(--bg-darker);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #333;
}

.tutorial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 204, 0, 0.1);
}

.tutorial-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #333;
}

.tutorial-content {
    padding: 1.5rem;
}

.tutorial-category {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.tutorial-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.tutorial-title a {
    color: var(--text-light);
    text-decoration: none;
}

.tutorial-title a:hover {
    color: var(--accent);
}

.tutorial-excerpt {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.read-more {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* Tutorial Detail */
.tutorial-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.tutorial-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tutorial-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.tutorial-excerpt {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 2rem;
    font-style: italic;
}

.category-tag {
    display: inline-block;
    background: var(--accent);
    color: var(--bg-dark);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.tutorial-body {
    background: var(--bg-darker);
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid #333;
}

.tutorial-body h2 {
    color: var(--accent);
    margin: 2rem 0 1rem 0;
    font-size: 1.5rem;
}

.tutorial-body h3 {
    margin: 1.5rem 0 1rem 0;
    font-size: 1.2rem;
}

.tutorial-body p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.tutorial-body ul, .tutorial-body ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.tutorial-body li {
    margin-bottom: 0.5rem;
}

.tutorial-body img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 1rem 0;
}

.tutorial-meta {
    color: var(--text-gray);
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tutorial-featured-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.tutorial-content {
    background: var(--bg-darker);
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid #333;
}

.tutorial-content h2 {
    color: var(--accent);
    margin: 2rem 0 1rem 0;
    font-size: 1.5rem;
}

.tutorial-content h3 {
    margin: 1.5rem 0 1rem 0;
    font-size: 1.2rem;
}

.tutorial-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.tutorial-content ul, .tutorial-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.tutorial-content li {
    margin-bottom: 0.5rem;
}

.tutorial-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 1rem 0;
}

.ads {
    background: #2a2a2a;
    border: 1px dashed #555;
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
    border-radius: 5px;
    color: var(--text-gray);
}

/* Table of Contents */
.toc {
    background: var(--bg-darker);
    padding: 1.5rem;
    border-radius: 10px;
    margin: 2rem 0;
    border-left: 4px solid var(--accent);
}

.toc h3 {
    color: var(--accent);
    margin-bottom: 1rem;
}

.toc ul {
    list-style: none;
    padding: 0;
}

.toc li {
    margin-bottom: 0.5rem;
}

.toc a {
    color: var(--text-light);
    text-decoration: none;
}

.toc a:hover {
    color: var(--accent);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--bg-darker) 0%, #1a1a1a 100%);
    border-top: 2px solid var(--accent);
    padding: 4rem 0 1rem;
    margin-top: 4rem;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

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

.footer-section {
    animation: fadeInUp 0.6s ease;
}

.footer-section h3 {
    color: var(--accent);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-description {
    color: var(--text-gray);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: var(--accent);
    margin-left: 5px;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2a2a2a;
    border-radius: 50%;
    color: var(--text-gray);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--accent);
    color: var(--bg-dark);
    transform: translateY(-3px);
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #333;
    background-color: #2a2a2a;
    color: var(--text-light);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--accent);
    background-color: #1a1a1a;
}

.newsletter-form button {
    padding: 0.8rem 1.5rem;
    background-color: var(--accent);
    color: var(--bg-dark);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.newsletter-form button:hover {
    background-color: #ffb300;
    transform: scale(1.05);
}

.footer-bottom {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid #333;
    color: var(--text-gray);
    font-size: 0.9rem;
}

.footer-bottom-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-bottom-links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-bottom-links a:hover {
    color: var(--accent);
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom-links {
        gap: 1rem;
    }
}

/* Search */
.search-container {
    max-width: 600px;
    margin: 2rem auto;
}

.search-box {
    display: flex;
    gap: 0;
}

.search-input {
    flex: 1;
    padding: 1rem;
    background: var(--bg-darker);
    border: 1px solid #333;
    border-right: none;
    border-radius: 5px 0 0 5px;
    color: var(--text-light);
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-button {
    background: var(--accent);
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    color: var(--bg-dark);
    font-weight: 600;
}

.search-button:hover {
    background: #ffdd44;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .tutorials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .tutorial-header h1 {
        font-size: 2rem;
    }

    .tutorial-content {
        padding: 1rem;
    }
}

/* Loading States */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-gray);
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { color: rgba(0,0,0,0); text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0); }
    40% { color: var(--text-gray); text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0); }
    60% { text-shadow: .25em 0 0 var(--text-gray), .5em 0 0 rgba(0,0,0,0); }
    80%, 100% { text-shadow: .25em 0 0 var(--text-gray), .5em 0 0 var(--text-gray); }
}

/* ============================================
   MODERN BOTTOM NAVIGATION - FIXED VERSION
   ============================================ */

.bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 999999 !important;
    will-change: transform;
    transform: translateZ(0) !important;
    width: 100% !important;
    margin: 0 !important;
    
    /* CRITICAL: Hide on desktop by default */
    display: none !important;
    
    background: var(--bg-darker);
    border-top: 1px solid #333;
    padding: 0.5rem 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: 70px;
    padding-bottom: env(safe-area-inset-bottom, 0.5rem);
    animation: slideUp 0.3s ease-out;
}

.bottom-nav.active {
    display: flex;
}

.nav-icons {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    padding: 0 1rem;
}

.nav-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-gray);
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s;
    min-width: 60px;
    flex: 1;
    max-width: 80px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.nav-icon:hover,
.nav-icon.active {
    color: var(--accent);
    background: rgba(255, 204, 0, 0.1);
}

.nav-icon i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    transition: all 0.3s;
}

.nav-icon span {
    font-size: 0.75rem;
    font-weight: 500;
}

.nav-icon.active i {
    transform: translateY(-2px);
    filter: drop-shadow(0 2px 8px rgba(255, 204, 0, 0.4));
}

.nav-icon.active span {
    font-weight: 600;
}

/* Haptic feedback effect */
.nav-icon:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

/* Critical mobile fixes */
@media (max-width: 768px) {
    .bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 9999 !important;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0));
        margin: 0 !important;
        width: 100% !important;
        height: 70px !important;
    }
    
    body {
        padding-bottom: 80px !important;
        margin-bottom: 0 !important;
        overflow-x: hidden;
        position: relative;
        min-height: 100vh;
    }
    
    html, body {
        height: 100%;
        width: 100%;
    }
    
    .footer {
        margin-bottom: 80px !important;
        position: relative;
        z-index: 1;
        padding-bottom: 1rem;
    }
    
    .header {
        position: relative;
        z-index: 1000;
    }
    
    .hero, .tutorials-grid, .tutorial-content, .footer-content, .container {
        position: relative;
        z-index: 1;
    }
    
    .mobile-menu-btn {
        display: none;
    }
    
    .nav-links {
        display: none !important;
    }
    
    /* Cookie consent positioning */
    #cookie-consent {
        bottom: 80px !important;
        z-index: 9998 !important;
        max-width: 100% !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* Smooth slide-up animation */
.bottom-nav {
    animation: slideUp 0.3s ease-out;
}

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

/* Extra small screens */
@media (max-width: 375px) {
    .nav-icon {
        padding: 0.4rem 0.5rem;
        min-width: 50px;
    }
    
    .nav-icon i {
        font-size: 1rem;
    }
    
    .nav-icon span {
        font-size: 0.6rem;
    }
}

/* ========================================
   DESKTOP - HIDE BOTTOM NAV COMPLETELY
   ======================================== */
@media (min-width: 769px) {
    .bottom-nav {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    
    body {
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .footer {
        margin-bottom: 0 !important;
    }
}
