/* ===========================
   CSS Variables & Reset
   =========================== */
:root {
    /* Color Palette */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    /* Neutral Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-color: #e5e7eb;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Courier New', monospace;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
}

/* Dark Theme */
body.dark-theme {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --border-color: #374151;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* ===========================
   Navigation Bar
   =========================== */
.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: background-color var(--transition-base);
}

body.dark-theme .navbar {
    background-color: rgba(17, 24, 39, 0.9);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.brand-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color var(--transition-fast);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
}

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

.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    transform: rotate(15deg);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--bg-primary);
        flex-direction: column;
        padding: var(--spacing-md);
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-links.active {
        display: flex;
    }
}

/* ===========================
   Hero Section
   =========================== */
.hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl) var(--spacing-md);
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    text-align: center;
    z-index: 2;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    margin-bottom: var(--spacing-md);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-subtitle {
    font-size: clamp(1.25rem, 3vw, 2rem);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    font-weight: 600;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* Floating Shapes Animation */
.hero-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-30px) rotate(90deg);
    }
    50% {
        transform: translateY(-60px) rotate(180deg);
    }
    75% {
        transform: translateY(-30px) rotate(270deg);
    }
}

/* ===========================
   Buttons
   =========================== */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-demo {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
}

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

.btn-code {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
}

.btn-code:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* ===========================
   Sections
   =========================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

section {
    padding: var(--spacing-2xl) 0;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.section-description {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: var(--spacing-xl);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ===========================
   Projects Section
   =========================== */
.projects-section {
    background-color: var(--bg-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.project-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 1px solid var(--border-color);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.project-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-live {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.status-deploying {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.status-docs {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.tech-badge {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tech Badge Colors */
.tech-javascript { background-color: rgba(247, 223, 30, 0.2); color: #f7df1e; }
.tech-html { background-color: rgba(227, 76, 38, 0.2); color: #e34c26; }
.tech-css { background-color: rgba(21, 114, 182, 0.2); color: #1572b6; }
.tech-react { background-color: rgba(97, 218, 251, 0.2); color: #61dafb; }
.tech-typescript { background-color: rgba(49, 120, 198, 0.2); color: #3178c6; }
.tech-vite { background-color: rgba(100, 108, 255, 0.2); color: #646cff; }
.tech-ai { background-color: rgba(138, 43, 226, 0.2); color: #8a2be2; }
.tech-express { background-color: rgba(0, 0, 0, 0.2); color: var(--text-primary); }
.tech-postgresql { background-color: rgba(51, 103, 145, 0.2); color: #336791; }
.tech-nodejs { background-color: rgba(104, 160, 99, 0.2); color: #68a063; }
.tech-websocket { background-color: rgba(16, 185, 129, 0.2); color: #10b981; }
.tech-discordjs { background-color: rgba(88, 101, 242, 0.2); color: #5865f2; }

.project-links {
    display: flex;
    gap: var(--spacing-sm);
}

.project-links .btn {
    flex: 1;
    text-align: center;
}

/* ===========================
   About Section
   =========================== */
.about-section {
    background-color: var(--bg-primary);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.about-text strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===========================
   Tech Stack Section
   =========================== */
.tech-section {
    background-color: var(--bg-secondary);
}

.tech-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.tech-category {
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.tech-category h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.tech-items {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

/* ===========================
   Contact Section
   =========================== */
.contact-section {
    background-color: var(--bg-primary);
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.contact-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.contact-link:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.contact-link .icon {
    width: 24px;
    height: 24px;
}

/* ===========================
   Footer
   =========================== */
.footer {
    background-color: var(--bg-secondary);
    padding: var(--spacing-xl) var(--spacing-md);
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.footer-links {
    margin-top: var(--spacing-sm);
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 var(--spacing-sm);
    transition: color var(--transition-fast);
}

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

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    .hero {
        min-height: 70vh;
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .tech-categories {
        grid-template-columns: 1fr;
    }
    
    .project-links {
        flex-direction: column;
    }
    
    .nav-links {
        gap: var(--spacing-xs);
    }
    
    section {
        padding: var(--spacing-xl) 0;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: var(--spacing-sm);
    }
    
    .contact-links {
        flex-direction: column;
        width: 100%;
    }
    
    .contact-link {
        width: 100%;
        justify-content: center;
    }
}

/* ===========================
   Animations & Utilities
   =========================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Smooth Scrolling */
html {
    scroll-padding-top: 80px;
}

/* Loading State */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

/* Print Styles */
@media print {
    .navbar,
    .theme-toggle,
    .hero-decoration,
    .floating-shape {
        display: none;
    }
}
