/**
 * ==========================================================================
 * PRANSHU CHAURASIA - PORTFOLIO SHARED STYLES
 * ==========================================================================
 * 
 * This stylesheet contains shared styles used across all pages.
 * Organized into logical sections for easy maintenance.
 * 
 * TABLE OF CONTENTS:
 * 1. CSS Variables (Design Tokens)
 * 2. Reset & Base Styles
 * 3. Typography
 * 4. Layout (Container, Grid)
 * 5. Background Effects (Grid, Orbs)
 * 6. Navigation
 * 7. Buttons & Links
 * 8. Cards & Components
 * 9. Badges & Tags
 * 10. Animations & Keyframes
 * 11. Responsive Breakpoints
 * 
 * ==========================================================================
 */


/* ==========================================================================
   1. CSS VARIABLES (Design Tokens)
   ========================================================================== */

/* Dark Theme (Default) */
:root {
    /* Background Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;

    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);

    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Border & Effects */
    --border-color: rgba(255, 255, 255, 0.08);
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --gradient-2: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);

    /* Status Colors */
    --success: #22c55e;

    /* Nav background */
    --nav-bg: rgba(10, 10, 15, 0.8);

    /* Grid opacity */
    --grid-opacity: 0.03;
    --orb-opacity: 0.15;
}

/* Light Theme - Soft, warm tones */
[data-theme="light"] {
    /* Background Colors - softer off-whites */
    --bg-primary: #faf9f7;
    --bg-secondary: #f5f4f2;
    --bg-tertiary: #efeee9;

    /* Text Colors */
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a5a;
    --text-muted: #6b6b7a;

    /* Border & Effects */
    --border-color: rgba(0, 0, 0, 0.1);
    --accent-glow: rgba(99, 102, 241, 0.2);

    /* Nav background - slight warmth */
    --nav-bg: rgba(250, 249, 247, 0.95);

    /* Grid and orbs - subtle */
    --grid-opacity: 0.04;
    --orb-opacity: 0.06;
}

/* ==========================================================================
   THEME TOGGLE BUTTON
   ========================================================================== */

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    margin-left: 16px;
}

.theme-toggle:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: rotate(15deg);
}

/* Hide appropriate icon based on theme */
.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: none;
}


/* ==========================================================================
   2. RESET & BASE STYLES
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}


/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'JetBrains Mono', monospace;
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 25%, #d946ef 50%, #8b5cf6 75%, #6366f1 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}


/* ==========================================================================
   4. LAYOUT
   ========================================================================== */

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

section {
    padding: 80px 0;
}


/* ==========================================================================
   5. BACKGROUND EFFECTS
   ========================================================================== */

/* Animated grid pattern */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    background-image:
        linear-gradient(rgba(99, 102, 241, var(--grid-opacity)) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, var(--grid-opacity)) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

/* Noise texture overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.02;
    z-index: 1000;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Floating glow orbs */
.glow-orb {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: var(--orb-opacity);
    pointer-events: none;
    z-index: -1;
    animation: floatOrb 20s ease-in-out infinite;
}

.glow-orb-1 {
    top: -200px;
    right: -200px;
    background: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
    animation-delay: 0s;
}

.glow-orb-2 {
    bottom: -200px;
    left: -200px;
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    animation-delay: -10s;
}


/* ==========================================================================
   6. NAVIGATION
   ========================================================================== */

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 0;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Terminal-style logo */
.logo {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 2px;
    transition: color 0.3s ease;
}

.logo:hover {
    color: #00ff41;
    /* Matrix green */
}

.logo:hover .terminal-cursor {
    background: #00ff41;
}

.terminal-text {
    overflow: hidden;
    white-space: nowrap;
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--text-primary);
    margin-left: 2px;
    animation: blink 1s step-end infinite;
}

/* Navigation links */
.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-1);
    transition: width 0.3s ease;
}

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

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

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}


/* ==========================================================================
   7. BUTTONS & LINKS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

/* Back link for subpages */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-link:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.back-link svg {
    width: 18px;
    height: 18px;
}


/* ==========================================================================
   8. CARDS & COMPONENTS
   ========================================================================== */

/* Section headers */
.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
}

.section-title::before {
    content: ">";
    color: var(--accent-primary);
    margin-right: 10px;
    animation: blink 1s step-end infinite;
}

/* Generic card style */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--accent-primary);
}


/* ==========================================================================
   9. BADGES & TAGS
   ========================================================================== */

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--accent-primary);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.badge .dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px var(--success);
}

/* Skill/Tech tags */
.tag {
    padding: 6px 14px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--accent-secondary);
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.2s ease;
}

.tag:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}


/* ==========================================================================
   10. ANIMATIONS & KEYFRAMES
   ========================================================================== */

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

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

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

@keyframes floatOrb {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(50px, 30px) scale(1.1);
    }

    50% {
        transform: translate(-30px, 50px) scale(0.95);
    }

    75% {
        transform: translate(30px, -20px) scale(1.05);
    }
}

/* Fade-in animation class */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

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


/* ==========================================================================
   11. RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 768px) {

    /* Mobile navigation */
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-secondary);
        padding: 24px;
        gap: 16px;
        border-bottom: 1px solid var(--border-color);
    }

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

    .mobile-menu-btn {
        display: flex;
    }

    /* Reduce section padding */
    section {
        padding: 60px 0;
    }
}


/* ==========================================================================
   END OF SHARED STYLES
   ========================================================================== */