@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700;900&display=swap');

:root {
    --primary: #6d28d9;
    --primary-light: #8b5cf6;
    --secondary: #10b981;
    --dark: #0f172a;
    --darker: #020617;
    --light: #f8fafc;
    --accent: #f59e0b;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 25%, #16213e 50%, #0f0f23 75%, #000000 100%);
    color: var(--light);
    overflow-x: hidden;
    position: relative;
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.gradient-text {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6, #10b981, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 300% 300%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.3);
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.card:hover::before {
    left: 100%;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 25px 50px rgba(139, 92, 246, 0.4),
        0 0 100px rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.7);
}

.section-divider {
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary-light), var(--secondary), var(--accent), transparent);
    border-radius: 2px;
}

.floating {
    animation: float 8s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(2deg); }
    66% { transform: translateY(-10px) rotate(-1deg); }
}

.pulse-ring {
    animation: pulse-ring 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(2.4); opacity: 0; }
}

.nav-item {
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.nav-item:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: translateY(-2px);
}

.nav-item.active {
    background: rgba(139, 92, 246, 0.3);
    color: #8b5cf6;
}

.section {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-bg {
    background: 
        radial-gradient(circle at 30% 20%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(16, 185, 129, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(2, 6, 23, 0.9) 100%);
}

.advanced-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    position: relative;
    overflow: hidden;
}

.advanced-badge::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.tech-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.tech-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.tech-item:hover {
    transform: translateY(-5px);
    border-color: rgba(139, 92, 246, 0.8);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

.workflow-step {
    background: rgba(15, 23, 42, 0.7);
    border-left: 4px solid;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    border-radius: 0.75rem;
}

.workflow-step:hover {
    transform: translateX(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.workflow-step p, .workflow-step ul, .workflow-step li {
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.workflow-step h3, .workflow-step h4, .workflow-step h5 {
    line-height: 1.3;
    margin-bottom: 1rem;
}

.step-1 { border-left-color: #8b5cf6; }
.step-2 { border-left-color: #3b82f6; }
.step-3 { border-left-color: #10b981; }
.step-4 { border-left-color: #f59e0b; }
.step-5 { border-left-color: #ef4444; }
.step-6 { border-left-color: #8b5cf6; }

.icon-3d {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.icon-3d:hover {
    transform: rotateY(180deg);
}

.gradient-border {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6, #10b981);
    padding: 2px;
    border-radius: 1rem;
}

.gradient-border-inner {
    background: rgba(15, 23, 42, 0.9);
    border-radius: calc(1rem - 2px);
}

.vibe-coding-section {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.flow-diagram {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 25px;
    margin: 50px 0;
}

.flow-step {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(59, 130, 246, 0.9));
    color: white;
    padding: 25px 35px;
    border-radius: 12px;
    font-weight: 400;
    min-width: 160px;
    position: relative;
    box-shadow: 0 8px 16px rgba(107, 91, 115, 0.2);
    font-size: 0.95rem;
    text-align: center;
}

.flow-step .step-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.flow-step .step-tech {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 300;
}

.flow-arrow {
    font-size: 24px;
    color: #8b5cf6;
    font-weight: 300;
}

.highlight {
    background: linear-gradient(120deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 400;
}

/* Image Modal Styles */
#imageModal {
    backdrop-filter: blur(5px);
}

#imageModal img {
    object-fit: contain;
}

/* Container and spacing fixes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Text spacing and line height fixes */
p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-bottom: 1rem;
}

ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Grid layout fixes */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .md\\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .md\\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .md\\:grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Space fixes for specific components */
.space-y-4 > * + * {
    margin-top: 1rem;
}

.space-y-6 > * + * {
    margin-top: 1.5rem;
}

.space-y-8 > * + * {
    margin-top: 2rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .flow-diagram {
        flex-direction: column;
    }
    
    .flow-arrow {
        transform: rotate(90deg);
    }
    
    .tech-stack {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .hero-bg h1 {
        font-size: 2.5rem;
    }
    
    .card {
        margin: 0.5rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .workflow-step {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Fix text overlap issues on mobile */
    .workflow-step h3 {
        font-size: 1.25rem;
        line-height: 1.4;
        margin-bottom: 1rem;
    }
    
    .workflow-step p {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 0.75rem;
    }
    
    .workflow-step ul {
        font-size: 0.85rem;
        line-height: 1.4;
    }
}