/**
 * Web Project Portfolio Styles
 * Portfolio 웹 프로젝트 페이지 전용 스타일
 */

: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);
}

/* ===== AdSense Optimization Styles ===== */
.ad-container {
    margin: 3rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ad-container:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.ad-label {
    position: absolute;
    top: 10px;
    left: 16px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 500;
    z-index: 1;
}

.adsbygoogle {
    width: 100%;
    max-width: 100%;
    display: block !important;
}

.top-banner-ad {
    margin: 2rem 0 3rem 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.middle-content-ad {
    margin: 4rem 0;
    grid-column: 1 / -1; /* Full width in grid */
}

.bottom-content-ad {
    margin: 3rem 0 2rem 0;
    grid-column: 1 / -1; /* Full width in grid */
}

.side-ad-container {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    max-height: 600px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
}

.desktop-only {
    display: block;
}

/* Ad loading states */
.ad-container:empty::after {
    content: '광고 로딩 중...';
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    text-align: center;
    animation: pulse 2s infinite;
}

.ad-container.failed::after {
    content: '광고를 불러올 수 없습니다';
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Responsive ad optimizations */
@media (max-width: 1400px) {
    .side-ad-container {
        display: none;
    }
}

@media (max-width: 768px) {
    .ad-container {
        margin: 2rem 0;
        padding: 1rem;
        min-height: 100px;
    }
    
    .top-banner-ad {
        margin: 1rem 0 2rem 0;
    }
    
    .middle-content-ad,
    .bottom-content-ad {
        margin: 2rem 0;
    }
    
    .ad-label {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
    
    .desktop-only {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .ad-container {
        margin: 1.5rem 0;
        padding: 0.75rem;
        min-height: 80px;
        border-radius: 12px;
    }
    
    .ad-label {
        top: 8px;
        left: 12px;
    }
}

/* 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);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #4a3aff, #764ba2);
    border-radius: var(--radius-full);
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #764ba2, #667eea);
    box-shadow: 0 0 10px rgba(118, 75, 162, 0.5);
}

/* 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: #764ba2;
}

/* 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;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Portfolio Items */
.portfolio-item {
    background: white;
    border-radius: 20px;
    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);
}

.portfolio-item.fade-in-up {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.portfolio-image {
    height: 220px;
    background: linear-gradient(135deg, #f7f8fa, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.portfolio-content {
    padding: 1.5rem;
}

.portfolio-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.portfolio-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.portfolio-tag {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 20px;
    padding: 6px 14px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.project-image {
    position: relative;
    height: 220px;
    background: linear-gradient(135deg, #f7f8fa, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-image.burning-burger {
    background: url('../assets/images/Burning Burger.png') center/cover, 
               linear-gradient(135deg, rgba(255, 87, 34, 0.8), rgba(255, 152, 0, 0.8));
    background-blend-mode: overlay;
}

.project-image.portal-page {
    background: url('../assets/images/Portal-page.png') center/cover, 
               linear-gradient(135deg, rgba(74, 58, 255, 0.8), rgba(118, 75, 162, 0.8));
    background-blend-mode: overlay;
}

.project-image.tistory-blog {
    background: url('../assets/images/Tistory-Blog.png') center/cover, 
               linear-gradient(135deg, rgba(34, 197, 94, 0.8), rgba(59, 130, 246, 0.8));
    background-blend-mode: overlay;
}

.project-image.coffee-beans {
    background: url('../assets/images/coffee-beans.png') center/cover, 
               linear-gradient(135deg, rgba(139, 69, 19, 0.8), rgba(160, 82, 45, 0.8));
    background-blend-mode: overlay;
}

.project-image.ai-humanoid {
    background: url('../assets/images/AI-humanoid.png') center/cover, 
               linear-gradient(135deg, rgba(99, 102, 241, 0.8), rgba(168, 85, 247, 0.8));
    background-blend-mode: overlay;
}

.project-image.music-display-web {
    background: url('../assets/images/music_display_web.png') center/cover, 
               linear-gradient(135deg, rgba(0, 255, 255, 0.8), rgba(255, 0, 255, 0.8));
    background-blend-mode: overlay;
}

.project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23e2e8f0" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.image-placeholder {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #4a3aff, #a5b4fc);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    position: relative;
}

.image-placeholder i {
    font-size: 2.5rem;
    color: white;
    opacity: 0.9;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(74, 58, 255, 0.9), rgba(118, 75, 162, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover .project-overlay {
    opacity: 1;
}

.project-links {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 300px;
}

.project-links.single-button {
    justify-content: center;
    max-width: 200px;
}

.project-link-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 120px !important;
    justify-content: center !important;
}

.project-link-btn i {
    font-size: 0.85rem;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.project-link-btn span {
    flex: 1;
    text-align: left;
    white-space: nowrap;
}

.project-link-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.project-link-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.project-content {
    padding: 24px;
}

.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-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.project-tag {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: #4a3aff;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 20px;
    padding: 6px 14px;
    border: 1px solid rgba(74, 58, 255, 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.demo {
    background: #fef3c7;
    color: #d97706;
    border-color: #fed7aa;
}

.project-status.concept {
    background: #e0e7ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* 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-links {
    flex-direction: column;
    gap: 12px;
}

.project-link-btn {
    min-width: 140px !important;
    justify-content: flex-start !important;
    gap: 12px !important;
}

/* 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(350px, 1fr));
        gap: 2rem;
    }
    
    .project-links {
        flex-direction: row;
        gap: 20px;
    }
}