/* ===================================
   MarketPro Toolkit - Main Stylesheet
   ================================== */

/* Root Variables - Luxury White & Gray Theme */
:root {
    --primary-color: #2c2c2c;
    --secondary-color: #6b6b6b;
    --accent-color: #1a1a1a;
    --success-color: #4a4a4a;
    --danger-color: #3d3d3d;
    --warning-color: #5a5a5a;
    --dark-color: #1a1a1a;
    --light-color: #fafafa;
    --lighter-color: #ffffff;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f8f8;
    --bg-tertiary: #f0f0f0;
    --text-primary: #1a1a1a;
    --text-secondary: #6b6b6b;
    --text-light: #9ca3af;
    --border-color: #e5e5e5;
    --border-light: #f0f0f0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 32px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 24px 48px -8px rgba(0, 0, 0, 0.12);
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

/* Navigation Bar - Luxury Design */
.navbar {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.05);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

/* 네비게이션 중앙 정렬 구조 */
.navbar .container-fluid {
    position: relative;
}

.navbar .navbar-collapse {
    position: static;
}

/* 중앙 메뉴를 절대 중앙에 배치 */
.navbar-nav.mx-auto {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    gap: 0.75rem; /* 메뉴 간격 고정 */
}

/* 중앙 메뉴의 각 아이템에 최소 너비 설정 */
.navbar-nav.mx-auto .nav-item {
    white-space: nowrap;
}

.navbar-nav.mx-auto .nav-link,
.navbar-nav.mx-auto .dropdown-toggle {
    min-width: 100px; /* 최소 너비 설정으로 일관성 유지 */
    text-align: center;
    padding: 0.5rem 1.5rem !important; /* 좌우 패딩 증가 */
}

/* 오른쪽 메뉴는 우측 끝에 고정 */
.navbar-nav.ms-auto {
    margin-left: auto !important;
}

/* 반응형: 모바일에서는 기본 레이아웃으로 복귀 */
@media (max-width: 991px) {
    .navbar-nav.mx-auto {
        position: static;
        transform: none;
        gap: 0;
    }
    
    .navbar-nav.mx-auto .nav-link,
    .navbar-nav.mx-auto .dropdown-toggle {
        min-width: auto;
        text-align: left;
        padding: 0.5rem 1rem !important;
    }
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
}

.navbar-brand:hover {
    opacity: 0.8;
}

/* Language Toggle Button */
.language-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-left: 1rem;
}

.language-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
}

.language-toggle .flag-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.language-toggle .lang-text {
    font-weight: 600;
    letter-spacing: 0.5px;
}

@media (max-width: 991px) {
    .language-toggle {
        margin-left: 0;
        margin-top: 1rem;
        justify-content: center;
    }
}

.navbar-brand i {
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1.25rem;
    transition: var(--transition-fast);
    position: relative;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition-fast);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--text-primary);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 70%;
}

.dropdown-menu {
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    display: none; /* 기본적으로 숨김 */
    transform-origin: top center;
    animation-duration: 0.3s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: both;
}

/* 두루마리 펼치기 애니메이션 */
@keyframes dropdownSlideDown {
    from {
        opacity: 0;
        transform: scaleY(0) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scaleY(1) translateY(0);
    }
}

@keyframes dropdownSlideUp {
    from {
        opacity: 1;
        transform: scaleY(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scaleY(0) translateY(-10px);
    }
}

/* 드롭다운 메뉴 표시 - 클릭 방식 */
.dropdown-menu.show {
    display: block !important;
    animation-name: dropdownSlideDown;
}

.dropdown-item {
    border-radius: 6px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.dropdown-item:hover,
.dropdown-item.active {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.dropdown-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    padding: 0.5rem 1rem 0.25rem;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: var(--border-light);
}

/* Hero Section - With Background Slider */
.hero-section {
    color: #ffffff;
    padding: 6rem 0 5rem;
    position: relative;
    overflow: hidden;
    min-height: 600px;
    display: flex;
    align-items: center;
}

/* 배경 이미지 슬라이더 with Swiper */
.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.heroSwiper {
    width: 100%;
    height: 100%;
}

.heroSwiper .swiper-slide {
    width: 100%;
    height: 100%;
}

.heroSwiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* 딤 처리 오버레이 */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.5) 100%
    );
    z-index: 1;
}

/* 콘텐츠를 최상단으로 */
.hero-section .container.hero-content {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease;
}

.hero-section .lead {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: #ffffff;
    opacity: 0.95;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease;
}

.hero-section .btn {
    animation: fadeInUp 1.2s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tool Cards - Luxury Design */
.tool-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2c2c2c 0%, #6b6b6b 100%);
    transform: scaleX(0);
    transition: var(--transition);
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: #d4d4d4;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: 14px;
    border: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    color: #2c2c2c;
}

.tool-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.tool-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.925rem;
    line-height: 1.6;
}

.tool-card .btn {
    width: 100%;
}

/* Buttons - Luxury Style */
.btn {
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    transition: var(--transition-fast);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-dark {
    background-color: var(--dark-color);
    color: white;
}

.btn-dark:hover {
    background-color: #000000;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a5a5a;
}

.btn-outline-dark {
    border: 1.5px solid var(--dark-color);
    color: var(--dark-color);
    background-color: transparent;
}

.btn-outline-dark:hover {
    background-color: var(--dark-color);
    color: white;
}

.btn-outline-primary {
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Tool Page Layout */
.tool-page {
    min-height: calc(100vh - 200px);
    padding: 3rem 0;
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tool-header h1 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.tool-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.tool-container {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

/* Form Styles */
.form-control,
.form-select {
    border-radius: 8px;
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 150px;
}

/* Result Box */
.result-box {
    background-color: var(--light-color);
    border-radius: 8px;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    margin-top: 1.5rem;
}

.result-box pre {
    background-color: var(--dark-color);
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0;
}

.result-box code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    padding: 1rem 1.5rem;
    border: none;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Footer - Minimal Luxury */
.footer {
    background-color: #fafafa;
    color: var(--text-secondary);
    padding: 4rem 0 2rem;
    margin-top: 5rem;
    border-top: 1px solid var(--border-light);
}

.footer h5 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer ul li {
    margin-bottom: 0.65rem;
}

.footer ul li a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.footer ul li a:hover {
    color: var(--text-primary);
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid var(--border-light);
    padding-top: 2rem;
    margin-top: 3rem;
    text-align: center;
    color: var(--text-light);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    border: 1px solid var(--border-light);
}

.social-links a:hover {
    background-color: var(--dark-color);
    color: white;
    transform: translateY(-3px);
    border-color: var(--dark-color);
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.badge-custom {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }

    .hero-section .lead {
        font-size: 1.1rem;
    }

    .tool-container {
        padding: 1.5rem;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 3rem 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .tool-card {
        padding: 1.5rem;
    }

    .btn {
        padding: 0.65rem 1.25rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background-color: var(--primary-color);
    color: white;
}

::-moz-selection {
    background-color: var(--primary-color);
    color: white;
}
