/* ========================================
   CypherCodes.org Enhanced Stylesheet
   Modern, Professional Design
======================================== */

:root {
    /* Primary Colors */
    --primary: #00b4d8;
    --primary-dark: #0096c7;
    --primary-light: #48cae4;
    --secondary: #7b2cbf;
    --secondary-light: #9d4edd;
    
    /* Accent Colors */
    --accent: #ff6b6b;
    --accent-gold: #ffd166;
    --success: #06d6a0;
    
    /* Neutral Colors */
    --dark: #0d1b2a;
    --darker: #051923;
    --gray-dark: #1b263b;
    --gray: #415a77;
    --gray-light: #778da9;
    --light: #e0e1dd;
    --white: #ffffff;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #00b4d8 0%, #7b2cbf 100%);
    --gradient-dark: linear-gradient(180deg, #0d1b2a 0%, #051923 100%);
    --gradient-card: linear-gradient(145deg, rgba(27, 38, 59, 0.8) 0%, rgba(13, 27, 42, 0.9) 100%);
    
    /* Typography */
    --font-display: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
    
    /* Spacing */
    --section-padding: 100px;
    --container-width: 1200px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 50px;
}

/* ========================================
   Reset & Base Styles
======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--darker);
    color: var(--light);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-normal);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

/* ========================================
   Typography
======================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--white);
}

h1 { font-size: clamp(2.5rem, 6vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p {
    color: var(--gray-light);
    font-size: 1.05rem;
}

.highlight {
    color: var(--primary-light);
    font-weight: 600;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Layout Utilities
======================================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 5%;
}

.section {
    padding: var(--section-padding) 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-tag {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: rgba(0, 180, 216, 0.1);
    border: 1px solid rgba(0, 180, 216, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary-light);
    margin-bottom: 1rem;
}

.section-title {
    margin-bottom: 1rem;
}

.section-subtitle {
    max-width: 700px;
    margin: 0 auto;
    color: var(--gray-light);
}

/* ========================================
   Animated Background
======================================== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-animation::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 180, 216, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(123, 44, 191, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(6, 214, 160, 0.04) 0%, transparent 50%);
    animation: bgFloat 30s ease-in-out infinite;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, 2%) rotate(1deg); }
    50% { transform: translate(0, 4%) rotate(0deg); }
    75% { transform: translate(-2%, 2%) rotate(-1deg); }
}

/* ========================================
   Navigation
======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(5, 25, 35, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 180, 216, 0.1);
    transition: var(--transition-normal);
}

.navbar.scrolled {
    padding: 0.75rem 5%;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo img {
    height: 50px;
    width: auto;
}

.nav-logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-logo-text .code {
    color: var(--primary-light);
}

.nav-logo-text .dance {
    color: var(--secondary-light);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--light);
    border-radius: var(--radius-sm);
    transition: var(--transition-normal);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-light);
    background: rgba(0, 180, 216, 0.1);
}

.nav-link.active {
    color: var(--primary-light);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--gray-dark);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition-normal);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 180, 216, 0.1);
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--light);
    transition: var(--transition-fast);
}

.nav-dropdown-item:hover {
    background: rgba(0, 180, 216, 0.15);
    color: var(--primary-light);
}

.nav-cta {
    margin-left: 1rem;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    background: transparent;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background: var(--light);
    border-radius: 2px;
    transition: var(--transition-normal);
}

/* ========================================
   Buttons
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: var(--transition-normal);
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 4px 20px rgba(0, 180, 216, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 180, 216, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--light);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    backdrop-filter: blur(10px);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-icon {
    padding: 0.75rem;
    border-radius: 50%;
}

/* ========================================
   Hero Section
======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text {
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 180, 216, 0.1);
    border: 1px solid rgba(0, 180, 216, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--primary-light);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease;
}

.hero-title {
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease 0.1s both;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-light);
    margin-bottom: 2rem;
    max-width: 500px;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease 0.3s both;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-stat {
    text-align: center;
}

.hero-stat-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-light);
}

.hero-stat-label {
    font-size: 0.85rem;
    color: var(--gray-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hero-visual {
    position: relative;
    z-index: 1;
    animation: fadeInRight 1s ease 0.3s both;
}

.hero-image {
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-xl);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.hero-decoration {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: var(--gradient-primary);
    filter: blur(100px);
    opacity: 0.3;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
}

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   Cards
======================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--gradient-card);
    border: 1px solid rgba(0, 180, 216, 0.1);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}

.card:hover {
    transform: translateY(-8px);
    border-color: rgba(0, 180, 216, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 180, 216, 0.1);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--gray-light);
    margin-bottom: 1.5rem;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-light);
    font-weight: 500;
    transition: var(--transition-fast);
}

.card-link:hover {
    gap: 1rem;
}

/* Feature Card Variant */
.feature-card {
    text-align: center;
    padding: 3rem 2rem;
}

.feature-card .card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    background: var(--gradient-primary);
    color: var(--white);
    border-radius: 50%;
}

/* ========================================
   Resource Section
======================================== */
.resource-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
}

.resource-category {
    background: var(--gradient-card);
    border: 1px solid rgba(0, 180, 216, 0.1);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    transition: var(--transition-normal);
}

.resource-category:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.resource-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: var(--gradient-primary);
    border-radius: 50%;
}

.resource-category h3 {
    margin-bottom: 1rem;
}

.resource-category p {
    margin-bottom: 1.5rem;
}

/* ========================================
   Competition Cards
======================================== */
.competition-grid {
    display: grid;
    gap: 2rem;
}

.competition-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
    align-items: center;
    background: var(--gradient-card);
    border: 1px solid rgba(0, 180, 216, 0.1);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition-normal);
}

.competition-card:hover {
    border-color: rgba(0, 180, 216, 0.3);
    transform: translateX(10px);
}

.competition-logo {
    width: 120px;
    height: 120px;
    background: rgba(0, 180, 216, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.competition-info h3 {
    margin-bottom: 0.5rem;
}

.competition-info p {
    font-size: 0.95rem;
}

/* ========================================
   Code Blocks
======================================== */
.code-block {
    background: var(--gray-dark);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    border: 1px solid rgba(0, 180, 216, 0.1);
}

.code-block pre {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--light);
    white-space: pre-wrap;
    line-height: 1.6;
}

.code-block .keyword { color: var(--secondary-light); }
.code-block .string { color: var(--success); }
.code-block .comment { color: var(--gray); }
.code-block .function { color: var(--primary-light); }

/* ========================================
   Data Structures Section
======================================== */
.ds-content {
    max-width: 900px;
    margin: 0 auto;
}

.ds-section {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(0, 180, 216, 0.1);
}

.ds-section:last-child {
    border-bottom: none;
}

.ds-section h3 {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--primary-light);
}

.ds-section h3::before {
    content: '▸';
    color: var(--secondary-light);
}

.ds-diagram {
    background: rgba(0, 180, 216, 0.05);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin: 1.5rem 0;
    text-align: center;
}

/* ========================================
   Impact Section
======================================== */
.impact-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
}

.impact-stat {
    text-align: center;
    padding: 2rem;
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 180, 216, 0.1);
}

.impact-number {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.impact-label {
    color: var(--gray-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
}

/* ========================================
   Contact Form
======================================== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
}

.contact-info {
    padding: 2rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 180, 216, 0.1);
    border-radius: var(--radius-md);
    font-size: 1.25rem;
}

.contact-form {
    background: var(--gradient-card);
    border: 1px solid rgba(0, 180, 216, 0.1);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--light);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 180, 216, 0.2);
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

/* ========================================
   Footer
======================================== */
.footer {
    background: var(--darker);
    border-top: 1px solid rgba(0, 180, 216, 0.1);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-logo img {
    height: 40px;
}

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

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 180, 216, 0.1);
    border-radius: 50%;
    color: var(--light);
    transition: var(--transition-fast);
}

.social-link:hover {
    background: var(--primary);
    color: var(--white);
}

.footer-title {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-link {
    color: var(--gray-light);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.footer-link:hover {
    color: var(--primary-light);
    padding-left: 5px;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 180, 216, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright {
    color: var(--gray);
    font-size: 0.9rem;
}

.footer-book-cta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ========================================
   Responsive Design
======================================== */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-subtitle {
        margin: 0 auto 2rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-visual {
        display: none;
    }
    
    .resource-categories {
        grid-template-columns: 1fr;
    }
    
    .impact-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 60px;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--gray-dark);
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
        transform: translateY(-150%);
        opacity: 0;
        transition: var(--transition-normal);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-cta {
        margin-left: 0;
        width: 100%;
    }
    
    .nav-cta .btn {
        width: 100%;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .competition-card {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .competition-logo {
        margin: 0 auto;
    }
    
    .impact-stats {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* ========================================
   Animations
======================================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered animations */
.stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger.visible > *:nth-child(1) { transition-delay: 0.1s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.2s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.3s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.4s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.5s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.6s; }

.stagger.visible > * {
    opacity: 1;
    transform: translateY(0);
}
