/* ========================================
   Image Effects - Common Styles
   ======================================== */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 16px;
}

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

body {
    font-family: 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========================================
   배경 애니메이션
   ======================================== */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3), transparent);
    filter: blur(60px);
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 500px;
    height: 500px;
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.circle-2 {
    width: 400px;
    height: 400px;
    top: 50%;
    right: -5%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.3), transparent);
    animation-delay: 7s;
}

.circle-3 {
    width: 600px;
    height: 600px;
    bottom: -15%;
    left: 40%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2), transparent);
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* ========================================
   헤더
   ======================================== */
.header {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo i {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Left group: logo + visitor stats to keep consistent spacing */
.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Visitor stats in header */
.visitor-stats {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: 1rem;
}

.visitor-stats .stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    background: linear-gradient(90deg, rgba(99,102,241,0.18), rgba(236,72,153,0.12));
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-primary);
    font-size: 0.95rem;
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 18px rgba(2,6,23,0.55);
}

.visitor-stats .stat .label {
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    margin-right: 0.45rem;
    font-size: 0.82rem;
    opacity: 0.95;
}

.visitor-stats .stat .value {
    font-weight: 900;
    color: #fff;
    text-shadow: 0 1px 0 rgba(0,0,0,0.3);
}

/* small separator for compact display */
.visitor-stats .sep {
    color: rgba(255,255,255,0.2);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .visitor-stats { display: none; }
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
    display: block;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: var(--transition);
}

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

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

/* 드롭다운 메뉴 */
.dropdown {
    position: relative;
}

.dropdown > a {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 200px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu a {
    padding: 0.75rem 1.5rem;
    display: block;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.dropdown-menu a::after {
    display: none;
}

.dropdown-menu a:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
    padding-left: 2rem;
}

/* 확장 메뉴 */
.nav-links > li {
    white-space: nowrap;
}

/* ========================================
   메인 컨테이너
   ======================================== */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* ========================================
   효과 섹션
   ======================================== */
.effect-section {
    margin: 3rem 0;
}

.effect-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.effect-description {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

/* ========================================
   효과 카드
   ======================================== */
.effect-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
}

.effect-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 35px rgba(0, 0, 0, 0.7);
}

/* ========================================
   이미지 비교 영역
   ======================================== */
.comparison-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.image-container {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.image-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(99, 102, 241, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10;
}

.preview-image {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
}

.upload-placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
}

.upload-placeholder i {
    font-size: 5rem;
    margin-bottom: 1rem;
    opacity: 0.6;
    color: var(--primary-light);
}

.upload-placeholder h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-placeholder p {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.upload-placeholder .btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

/* ========================================
   컨트롤 영역
   ======================================== */
.controls-area {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 2rem 0;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.slider-value {
    min-width: 60px;
    text-align: center;
    font-weight: 700;
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.slider-value:hover {
    background: rgba(99, 102, 241, 0.3);
    transform: scale(1.05);
}

input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
    border-radius: 4px;
}

/* ========================================
   버튼 스타일
   ======================================== */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   상태 표시
   ======================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

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

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

.status-processing {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========================================
   푸터
   ======================================== */
.footer {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 5rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    /* Match home.css: use horizontal layout so links and processed-data align side-by-side */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

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

/* Processed-data in footer (fragments/processed.html) - shared with home.css */
.footer-processed {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.9rem;
    background: linear-gradient(90deg, rgba(99,102,241,0.08), rgba(236,72,153,0.06));
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-secondary);
    font-size: 0.95rem;
    backdrop-filter: blur(6px);
}

.footer-processed .label {
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    font-size: 0.82rem;
}

.footer-processed .value {
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 0 rgba(0,0,0,0.3);
}

/* ========================================
   반응형 디자인
   ======================================== */
/* 1단계: 900px 이하 - 방문자 수 숨김 */
@media (max-width: 900px) {
    .visitor-stats {
        display: none;
    }
}

/* 2단계: 900px 이하 - 메뉴 간격 줄이기 */
@media (max-width: 900px) {
    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .logo i {
        font-size: 1.5rem;
    }
}

/* 3단계: 768px 이하 - 로고와 메뉴 더 축소 */
@media (max-width: 768px) {
    .header {
        padding: 0.5rem 0;
    }
    
    .nav-container {
        padding: 0 1rem;
        gap: 0.5rem;
        justify-content: space-between;
        width: 100%;
    }
    
    .logo {
        font-size: clamp(1rem, 4vw, 1.3rem);
        gap: 0.3rem;
        flex: 0 0 auto;
    }
    
    .logo i {
        font-size: clamp(1.2rem, 4.5vw, 1.5rem);
    }
    
    .nav-links {
        gap: clamp(0.5rem, 2vw, 1rem);
        font-size: clamp(0.8rem, 2.5vw, 1rem);
        flex: 1 1 auto;
        justify-content: flex-end;
    }
    
    .nav-links a {
        padding: 0.3rem 0;
        white-space: nowrap;
    }
    
    .dropdown-menu {
        font-size: 0.85rem;
        min-width: 140px;
    }
    
    .comparison-area {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    /* 헤더 더 축소 */
    .header {
        padding: 0.4rem 0;
    }
    
    .nav-container {
        padding: 0 0.5rem;
    }
    
    /* 로고 더 작게 */
    .logo {
        font-size: 0.95rem;
        gap: 0.25rem;
    }
    
    .logo i {
        font-size: 1.1rem;
    }
    
    /* 메뉴 더 작게 */
    .nav-links {
        gap: 0.3rem;
        font-size: 0.75rem;
    }
    
    .nav-links a {
        padding: 0.2rem 0;
    }

    .dropdown-menu {
        font-size: 0.8rem;
        min-width: 120px;
        padding: 0.3rem;
    }
    
    .dropdown-menu li a {
        padding: 0.4rem 0.6rem;
    }
    
    .effect-card {
        padding: 1.5rem;
    }
}


/* ========================================
   알림 스타일
   ======================================== */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    animation: slideInRight 0.3s ease-out;
    backdrop-filter: blur(10px);
}

.notification-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.notification-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.notification-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ========================================
   로딩 스피너
   ======================================== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
