/**
 * Opensource Portfolio Styles
 * 오픈소스 프로젝트 포트폴리오 페이지 전용 스타일
 */

:root {
    --radius-full: 9999px;
    
    /* Standard Color System */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #8b5cf6;
    
    --secondary: #06d6a0;
    --accent: #f59e0b;
    
    --dark: #0f172a;
    --dark-light: #1e293b;
    
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06d6a0 100%);
    --gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* Enhanced Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: var(--gradient-primary);
    z-index: 10000;
    transition: width 0.05s ease-out;
    border-radius: 0 0 2px 0;
}

.progress-bar.near-complete {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.6),
               0 0 30px rgba(99, 102, 241, 0.4);
    filter: brightness(1.2);
}

/* Navigation Back Button */
.nav-back {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-back:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    color: #ddd6fe;
}

/* Hide nav-back on desktop, show only on mobile */
@media (min-width: 769px) {
    .nav-back {
        display: none;
    }
}

.nav-back svg {
    width: 16px;
    height: 16px;
}

body { 
    background: var(--gradient-primary);
    min-height: 100vh;
    font-family: var(--font-family-sans, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--gradient-primary);
}

.floating-element {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    pointer-events: none;
    animation: float 6s ease-in-out infinite;
}

.floating-1 {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.floating-3 {
    width: 80px;
    height: 80px;
    bottom: 30%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(120deg); }
    66% { transform: translateY(10px) rotate(240deg); }
}

.hero-content {
    text-align: center;
    color: white;
    z-index: 2;
    max-width: 800px;
    padding: 0 2rem;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
    white-space: nowrap;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    opacity: 0.9;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: -120%;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    flex-direction: column;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.scroll-indicator:hover {
    color: white;
    transform: translateX(-50%) translateY(-5px);
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border: 2px solid currentColor;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    animation: bounce 2s infinite;
}

.scroll-arrow i {
    font-size: 12px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Show scroll indicator on desktop */
@media (min-width: 769px) {
    .scroll-indicator {
        display: flex;
    }
}

/* Content Section */
.content-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    margin: -100px 0 0 0;
    position: relative;
    z-index: 3;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1rem;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.header-section {
    text-align: center;
    margin-bottom: 48px;
}

.opensource-character {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    border-radius: 20px;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
    animation: gitFloat 4s ease-in-out infinite;
    transform-style: preserve-3d;
}

@keyframes gitFloat {
    0%, 100% { transform: rotateY(0deg) rotateX(0deg); }
    25% { transform: rotateY(-10deg) rotateX(5deg); }
    50% { transform: rotateY(0deg) rotateX(-5deg); }
    75% { transform: rotateY(10deg) rotateX(5deg); }
}

.opensource-character img {
    width: 80px;
    height: 80px;
    filter: brightness(1.2);
}

.opensource-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.opensource-desc {
    color: #666;
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Project Items */
.project-item {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
}

.project-item.fade-in-up {
    opacity: 1;
    transform: translateY(0);
}

.project-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.project-preview {
    position: relative;
    height: 280px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.terminal-mockup {
    width: 90%;
    height: 220px;
    background: #1a202c;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: perspective(1000px) rotateY(-3deg);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.project-item:hover .terminal-mockup {
    transform: perspective(1000px) rotateY(0deg) scale(1.02);
}

.terminal-header {
    background: #2d3748;
    height: 30px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 6px;
}

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-button.close { background: #ef4444; }
.terminal-button.minimize { background: #f59e0b; }
.terminal-button.maximize { background: #10b981; }

.terminal-content {
    flex: 1;
    background: #1a202c;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.terminal-content::before {
    content: '$ git clone repository';
    position: absolute;
    top: 10px;
    left: 12px;
    color: #10b981;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.project-icon {
    font-size: 3rem;
    color: #06b6d4;
    opacity: 0.9;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.9), rgba(59, 130, 246, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-item:hover .project-overlay {
    opacity: 1;
}

.project-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.action-button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 8px;
    width: 160px;
    justify-content: center;
}

.action-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.action-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.project-content {
    padding: 24px;
}

.project-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.stat-badge {
    background: linear-gradient(135deg, #e0f2fe, #b3e5fc);
    color: #0277bd;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 16px;
    padding: 4px 10px;
    border: 1px solid rgba(2, 119, 189, 0.1);
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-badge.stars {
    background: linear-gradient(135deg, #fef3c7, #fed7aa);
    color: #d97706;
    border-color: rgba(217, 119, 6, 0.1);
}

.stat-badge.forks {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #16a34a;
    border-color: rgba(22, 163, 74, 0.1);
}

.project-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
    line-height: 1.3;
}

.project-desc {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.project-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.feature-tag {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    color: #0369a1;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 16px;
    padding: 4px 12px;
    border: 1px solid rgba(3, 105, 161, 0.1);
}

.project-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #dcfce7;
    color: #16a34a;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #bbf7d0;
}

.project-status.active {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

.project-status.archived {
    background: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
}

.project-status.planning {
    background: #fef3c7;
    color: #d97706;
    border-color: #fed7aa;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}


.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.tech-tag {
    background: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 12px;
    padding: 3px 8px;
    border: 1px solid #e2e8f0;
}

.license-badge {
    background: #ede9fe;
    color: #7c3aed;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 16px;
    padding: 3px 8px;
    border: 1px solid rgba(124, 58, 237, 0.1);
}

/* Mobile First Responsive Design */

/* Base styles (Mobile) */
.container {
    padding: 2rem 1rem;
}

.hero-content {
    padding: 0 1rem;
}

.hero-cta {
    flex-direction: column;
    align-items: center;
}

.btn-primary, .btn-secondary {
    width: 100%;
    max-width: 280px;
    justify-content: center;
}

.content-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.project-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

.action-button {
    width: auto;
    min-width: 140px;
}

/* Desktop (769px and above) */
@media (min-width: 769px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 4rem 2rem;
    }
    
    .nav-back {
        display: none;
    }
    
    .hero-cta {
        flex-direction: row;
    }
    
    .btn-primary, .btn-secondary {
        width: auto;
    }
    
    .content-grid {
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
        gap: 2rem;
    }
}