/* 
 * LinkPick - 공통 스타일시트
 * 모든 페이지에서 공통으로 사용하는 CSS
 */

/* ========== CSS Variables ========== */
:root {
    /* 기본 색상 */
    --white: #FFFFFF;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-card: #FEFEFE;
    --border: #E5E7EB;
    
    /* 브랜드 색상 */
    --primary: #7C3AED;
    --primary-dark: #6D28D9;
    --secondary: #3B82F6;
    --purple: #7C3AED;
    --blue: #3B82F6;
    --orange: #F59E0B;
    --red: #EF4444;
    --green: #10B981;
    
    /* 텍스트 색상 */
    --text-primary: #1A1A1A;
    --text-secondary: #4A4A4A;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;
    
    /* 그라디언트 */
    --gradient-primary: linear-gradient(135deg, #7C3AED 0%, #3B82F6 100%);
    --gradient-orange: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
    --gradient-purple: linear-gradient(135deg, #A78BFA 0%, #7C3AED 100%);
}

/* ========== 전역 리셋 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== 컨테이너 ========== */
.container {
    max-width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 80px;
}

@media (min-width: 768px) {
    .container {
        padding-bottom: 20px;
    }
}

/* ========== 상단 네비게이션 (PC/태블릿) ========== */
.top-nav {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: none;
}

@media (min-width: 768px) {
    .top-nav {
        display: block;
    }
}

.top-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
}

.service-intro-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.service-intro-link:hover {
    background: var(--bg-secondary);
    border-color: var(--purple);
    color: var(--purple);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.nav-link:hover {
    background: var(--bg-card);
}

.nav-link.active {
    background: var(--gradient-primary);
    color: white;
}

.nav-link-icon {
    font-size: 18px;
}

.nav-add-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* ========== 하단 네비게이션 (모바일) ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding: 6px 0 16px;
    z-index: 1000;
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px;
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--purple);
}

.nav-icon {
    font-size: 22px;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
}

.nav-add {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    font-weight: 300;
    margin-bottom: 8px;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-add:active {
    transform: scale(0.95);
}

/* ========== 헤더 ========== */
.header {
    position: sticky;
    top: 0;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 16px;
    z-index: 100;
}

@media (min-width: 768px) {
    .header {
        display: none;
    }
}

.header-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn,
.back-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.back-btn:hover,
.back-button:hover {
    background: var(--border);
}

.page-title,
.header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

/* ========== 카드 컴포넌트 ========== */
.card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
}

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

/* ========== 버튼 스타일 ========== */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

.btn-danger {
    background: var(--red);
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
}

/* ========== 입력 필드 ========== */
.input-field {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.input-field::placeholder {
    color: var(--text-light);
}

textarea.input-field {
    resize: vertical;
    min-height: 100px;
}

/* ========== 배지 ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: rgba(124, 58, 237, 0.1);
    color: var(--purple);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--orange);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
}

/* ========== 그라디언트 배경 ========== */
.gradient-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.gradient-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.gradient-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.gradient-4 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.gradient-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.gradient-6 { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }

/* ========== 유틸리티 클래스 ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.w-full { width: 100%; }
.h-full { height: 100%; }

/* ========== 애니메이션 ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-up {
    animation: slideUp 0.3s ease;
}

.slide-down {
    animation: slideDown 0.3s ease;
}

/* ========== Toast ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-hide {
    opacity: 0;
    transform: translateX(100%);
}

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.toast-msg {
    flex: 1;
}

.toast-success { border-left: 4px solid #10B981; }
.toast-error { border-left: 4px solid #EF4444; }
.toast-info { border-left: 4px solid #3B82F6; }
.toast-warning { border-left: 4px solid #F59E0B; }

/* ========== Loading Overlay ========== */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    font-size: 14px;
    color: var(--text-muted);
}
