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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0f;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(102, 126, 234, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(167, 139, 250, 0.05) 0%, transparent 50%);
    color: #e0e0e0;
    line-height: 1.6;
    padding-top: 80px;
    overflow-x: hidden;
}

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

::-webkit-scrollbar-track {
    background: #202e1a;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #a78bfa);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8, #9575e6);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation Header */
.nav-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(102, 126, 234, 0.15);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-header.scrolled {
    background: rgba(10, 10, 15, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.nav-logo {
    font-size: 1.5em;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: all 0.3s ease;
    letter-spacing: -0.02em;
}

.nav-logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 40px;
    align-items: center;
    list-style: none;
}

.nav-links a {
    color: #b4b4d4;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 8px 16px;
    border-radius: 8px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #a78bfa);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: #fff;
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

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

.nav-social {
    display: flex;
    gap: 15px;
}

.nav-social a {
    color: #9090b0;
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.nav-social a:hover {
    color: #a78bfa;
    transform: translateY(-2px);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #b4b4d4;
    font-size: 1.5em;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a3e 100%);
    padding: 140px 20px 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.2) 0%, transparent 60%),
        radial-gradient(circle at 80% 20%, rgba(167, 139, 250, 0.2) 0%, transparent 60%),
        radial-gradient(circle at 40% 80%, rgba(118, 75, 162, 0.15) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    z-index: 0;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    33% {
        transform: translateY(-20px) rotate(1deg);
    }

    66% {
        transform: translateY(10px) rotate(-1deg);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
}

h1 {
    font-size: 4.2em;
    color: #fff;
    margin-bottom: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #a78bfa 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    line-height: 1.05;
    animation: fadeInUp 0.8s ease-out;
    text-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tagline {
    font-size: 1.8em;
    color: #d0d0f0;
    margin-bottom: 48px;
    font-weight: 400;
    animation: fadeInUp 1s ease-out 0.2s both;
    letter-spacing: -0.01em;
    line-height: 1.4;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Tutorials Specific Styles */
.tutorials-hero {
    min-height: 60vh;
    padding-bottom: 60px;
}

.search-section {
    padding: 0 20px 40px;
    margin-top: -40px;
    position: relative;
    z-index: 10;
}

.search-container {
    background: rgba(20, 20, 35, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 20px;
    padding: 20px;
    display: grid;
    gap: 16px;
    grid-template-columns: 2fr 1fr 1fr auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.search-container:hover {
    border-color: rgba(102, 126, 234, 0.35);
    background: rgba(20, 20, 35, 0.75);
}

.search-box {
    position: relative;
}

#searchInput {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.2);
    padding: 14px 16px 14px 48px;
    border-radius: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 1em;
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

#topicFilter,
#levelFilter {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.2);
    padding: 14px;
    border-radius: 12px;
    color: #b4b4d4;
    font-family: inherit;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    /* potentially hide native arrow to replace with custom SVG if desired, but sticking to native for simplicity for now, just styled */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

#topicFilter:hover,
#levelFilter:hover {
    border-color: rgba(102, 126, 234, 0.4);
    color: #fff;
}

#topicFilter:focus,
#levelFilter:focus {
    outline: none;
    border-color: #667eea;
}

.view-toggle {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.tutorials-section {
    padding-bottom: 120px;
    min-height: 500px;
}

#tutorialsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

/* Tutorials Card Styles (extracted from inline JS/HTML styles for cleanliness if possible, but JS generated them inline. I should define classes here to replace inline JS styles if I want a clean separate) */
/* Tutorials Card Styles */
.tutorial-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.tutorial-card:hover {
    transform: translateY(-8px);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.06);
}

.tutorial-card:hover .card-thumb img {
    transform: scale(1.08);
}

/* List View Overrides */
.tutorial-card.list-view {
    flex-direction: row;
    height: 220px;
}

.tutorial-card.list-view .card-thumb {
    width: 320px;
    height: 100%;
    aspect-ratio: auto;
}

/* Card Sub-elements */
.card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    position: relative;
    overflow: hidden;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.card-duration {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.75);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: 600;
    color: #fff;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.card-topic {
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a78bfa;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    padding: 6px 12px;
    border-radius: 50px;
    font-weight: 600;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: none;
    border: none;
    color: #9090b0;
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    color: #fff;
    transform: scale(1.1);
}

.card-title {
    font-size: 1.4em;
    margin-bottom: 12px;
    line-height: 1.3;
    color: #fff;
    font-weight: 700;
}

.card-desc {
    color: #9090b0;
    font-size: 0.95em;
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 20px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 16px;
    margin-top: auto;
}

.card-level {
    font-size: 0.85em;
    color: #707090;
    text-transform: capitalize;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-level::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #707090;
}

.card-level.beginner::before {
    background: #2ed598;
}

.card-level.intermediate::before {
    background: #ffc107;
}

.card-level.advanced::before {
    background: #ff4757;
}

.watch-btn {
    background: none;
    border: none;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.watch-btn:hover {
    color: #fff;
    gap: 10px;
}

/* Share Menu Styles */
.share-dropdown {
    position: relative;
}

.share-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: rgba(15, 15, 35, 0.95);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    padding: 8px;
    flex-direction: column;
    gap: 6px;
    z-index: 100;
    min-width: 120px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.share-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    text-align: left;
    border-radius: 4px;
    font-size: 0.9em;
}

.share-menu button:hover {
    background: rgba(102, 126, 234, 0.2);
}

/* Video Popup */
.video-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.video-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 20px;
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    text-align: center;
    max-width: 900px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: popupScale 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* WhatsApp Popup */
.whatsapp-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.whatsapp-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: popupScale 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popupScale {
    from {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.close-popup {
    position: absolute;
    top: 15px;
    right: 25px;
    background: none;
    border: none;
    color: #b4b4d4;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 20;
}

.close-popup:hover {
    color: #fff;
}

/* Popup Header Branding */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.popup-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2em;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #667eea, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.popup-logo {
    width: 30px;
    height: auto;
}

/* Reset close button for header placement */
.video-popup-content .close-popup {
    position: static;
    font-size: 2em;
    padding: 0;
    line-height: 1;
}

.phone-number {
    font-size: 1.8em;
    font-weight: 700;
    color: #fff;
    margin: 20px 0;
    letter-spacing: 1px;
}

.whatsapp-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.whatsapp-btn {
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.whatsapp-btn.primary {
    background: #25D366;
    color: #fff;
    border: none;
}

.whatsapp-btn.primary:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

.whatsapp-btn.secondary {
    background: transparent;
    border: 1px solid #b4b4d4;
    color: #b4b4d4;
}

.whatsapp-btn.secondary:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

/* Easter Egg Toast */
.easter-egg-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(15, 15, 30, 0.95);
    border: 1px solid rgba(102, 126, 234, 0.3);
    padding: 16px 24px;
    border-radius: 50px;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 10px;
}

.easter-egg-toast::before {
    content: '🤫';
    font-size: 1.5em;
}

.easter-egg-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 900px) {
    .search-container {
        grid-template-columns: 1fr 1fr;
    }

    .view-toggle {
        display: none;
    }
}

@media (max-width: 600px) {
    .search-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .hero {
        padding: 100px 20px 60px;
    }

    h1 {
        font-size: 2.8em;
    }

    .tagline {
        font-size: 1.2em;
    }
}

/* Footer Styles */
footer {
    background: linear-gradient(135deg, #0a0a18 0%, #1a1a2e 100%);
    padding: 60px 20px 40px;
    text-align: center;
    border-top: 1px solid rgba(102, 126, 234, 0.15);
    position: relative;
    margin-top: 60px;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.5), transparent);
}

.open-source-badge {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 30px;
    background: rgba(102, 126, 234, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 30px;
    color: #a78bfa;
    font-weight: 600;
    transition: all 0.3s ease;
}

.open-source-badge:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.philosophy-statement {
    color: #9090b0;
    font-size: 0.9em;
    font-style: italic;
    margin-top: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
    opacity: 0.8;
}