/* 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 214, 0, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 105, 180, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(0, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(124, 252, 0, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 100%, rgba(255, 20, 147, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    animation: backgroundShift 20s ease-in-out infinite;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

/* 헤더 */
header {
    text-align: center;
    margin-bottom: 3rem;
}

.main-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.logo {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, #6366f1, #8b5cf6, #ec4899);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease-in-out infinite;
    text-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.tagline {
    font-size: 1.2rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.5px;
}

.subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    font-weight: 300;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes backgroundShift {
    0% { 
        filter: hue-rotate(0deg) brightness(1);
    }
    25% { 
        filter: hue-rotate(90deg) brightness(1.1);
    }
    50% { 
        filter: hue-rotate(180deg) brightness(1);
    }
    75% { 
        filter: hue-rotate(270deg) brightness(1.1);
    }
    100% { 
        filter: hue-rotate(360deg) brightness(1);
    }
}

/* 필터 버튼 */
.filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.filter-btn.active {
    background: linear-gradient(45deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

/* 서비스 그리드 */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* 1개 서비스일 때 중앙 정렬 및 크기 제한 */
.services-grid.single-service {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    grid-template-columns: 1fr;
}

/* 2개 이상일 때는 기본 그리드 */
.services-grid.multiple-services {
    max-width: none;
}

.service-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.8));
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 350px;
}


.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.service-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.service-category {
    background: linear-gradient(45deg, #6366f1, #8b5cf6);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.status-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.status-indicator.online {
    background: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.6), inset 0 1px 2px rgba(255,255,255,0.3);
    animation: glow 2s ease-in-out infinite;
}

.status-indicator.offline {
    background: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6), inset 0 1px 2px rgba(255,255,255,0.3);
}

.status-indicator.checking {
    background: #f59e0b;
    animation: pulse 1.5s infinite, glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { 
        box-shadow: 0 0 15px rgba(16, 185, 129, 0.6), inset 0 1px 2px rgba(255,255,255,0.3);
    }
    50% { 
        box-shadow: 0 0 25px rgba(16, 185, 129, 0.8), inset 0 1px 2px rgba(255,255,255,0.5);
    }
}

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

.service-description {
    color: #475569;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    font-size: 0.95rem;
}

.service-url {
    font-family: 'Monaco', 'Menlo', monospace;
    color: #6366f1;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    padding: 0.6rem 1rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.service-url::before {
    content: '🔗';
    margin-right: 0.5rem;
    opacity: 0.7;
}

.service-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.btn-visit {
    flex: 1;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(45deg, #6366f1, #8b5cf6);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: inline-block;
    font-size: 0.9rem;
}

.btn-visit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

.btn-visit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-refresh {
    padding: 0.75rem;
    border: none;
    border-radius: 12px;
    background: rgba(233, 30, 99, 0.1);
    color: #e91e63;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.btn-refresh:hover {
    background: rgba(233, 30, 99, 0.2);
    transform: rotate(180deg);
}

/* 로딩 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 푸터 */
/* 페이지 콘텐츠 (About, Contact, Privacy, Terms 페이지용) */
.page-content {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* 푸터 */
footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: auto;
    width: 100%;
    box-sizing: border-box;
}

/* 네비게이션 */
.main-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 2rem;
}

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

.nav-logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(45deg, #e91e63, #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    flex: 1;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(233, 30, 99, 0.1);
    color: #e91e63;
}

.nav-link.active {
    background: linear-gradient(45deg, #e91e63, #ff6b35);
    color: white;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: #333;
    transition: all 0.3s ease;
}

/* 번역 가능한 요소들을 처음에 숨김 (깜빡임 방지) */
[data-translate] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

[data-translate].translated {
    opacity: 1;
}

/* 네비게이션 안의 언어 선택 */
.language-selector {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lang-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.7);
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.8rem;
    backdrop-filter: blur(5px);
}

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

.lang-btn.active {
    background: linear-gradient(45deg, #e91e63, #ff6b35);
    color: white;
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.8);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* 중간 크기 화면 대응 */
@media (max-width: 1000px) and (min-width: 769px) {
    .nav-container {
        gap: 1rem; /* 간격 줄임 */
    }
    
    .nav-menu {
        gap: 1rem; /* 메뉴 간격 줄임 */
    }
    
    .nav-link {
        padding: 0.5rem 0.8rem; /* 패딩 줄임 */
        font-size: 0.9rem;
    }
    
    .lang-btn {
        padding: 0.3rem 0.6rem; /* 언어 버튼 크기 줄임 */
        font-size: 0.75rem;
    }
}

/* 햄버거 메뉴로 전환 (더 일찍 전환) */
@media (max-width: 900px) {
    .container {
        padding: 1rem;
    }
    
    .logo {
        font-size: 2.5rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .filters {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    /* 모바일 네비게이션 */
    .nav-container {
        padding: 1rem;
        gap: 1rem;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        gap: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        z-index: 99;
        flex: none;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-link {
        padding: 1rem 2rem;
        border-radius: 0;
        border-bottom: 1px solid rgba(233, 30, 99, 0.1);
    }
    
    .mobile-menu-btn {
        display: flex;
        order: 3;
    }
    
    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* 모바일에서 언어 선택기를 메뉴 안으로 */
    .language-selector {
        display: none;
        order: 2;
    }
    
    .nav-menu.active ~ .language-selector {
        display: flex;
        position: absolute;
        top: 100%;
        right: 1rem;
        background: rgba(255, 255, 255, 0.95);
        padding: 1rem;
        border-radius: 10px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        margin-top: 1rem;
        z-index: 101;
    }
    
    .lang-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
        min-width: 40px;
    }
}