/**
 * YourIT 마이페이지 - 공통 CSS
 * 사이드바, 탑바, 레이아웃 등 모든 페이지에서 재사용되는 스타일
 */

/* ==========================================================================
   CSS Variables - Light Mode (Default)
   ========================================================================== */
:root {
    /* Primary Colors */
    --primary: #00D4AA;
    --primary-dark: #00b894;
    --primary-light: #e8faf6;
    --primary-gradient: linear-gradient(135deg, #00D4AA, #00B4D8);
    --primary-glow: rgba(0, 212, 170, 0.4);

    /* Status Colors */
    --success: #00D4AA;
    --success-bg: #e8faf6;
    --warning: #ffb300;
    --warning-bg: #fff8e6;
    --danger: #ff5252;
    --danger-bg: #ffebee;
    --info: #2196f3;
    --info-bg: #e3f2fd;

    /* Text Colors */
    --text-dark: #191f28;
    --text-primary: #333d4b;
    --text-secondary: #6b7684;
    --text-tertiary: #8b95a1;

    /* Background Colors */
    --bg-body: #f5f7fa;
    --bg-card: #fff;
    --bg-light: #f8fafb;
    --bg-primary: #fff;
    --bg-secondary: #fff;
    --bg-tertiary: #f8fafb;
    --bg-sidebar: linear-gradient(180deg, #1a1f2e 0%, #0f1419 100%);
    --bg-sidebar-solid: #151a24;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.08);
    --bg-topbar: rgba(255, 255, 255, 0.85);
    --bg-hover: #f8fafb;
    --bg-input: #fff;

    /* Border & Shadow */
    --border-color: #e5e8eb;
    --border-light: #f1f3f5;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 40px var(--primary-glow);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);

    /* Sizes */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --sidebar-width: 260px;
    --topbar-height: 64px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Color Scheme */
    color-scheme: light;
}

/* ==========================================================================
   CSS Variables - Dark Mode (data-theme="dark" 또는 시스템 다크모드)
   ========================================================================== */
[data-theme="dark"] {
    /* Primary Colors - 다크모드에서 약간 밝게 */
    --primary: #00E5B8;
    --primary-dark: #00D4AA;
    --primary-light: rgba(0, 212, 170, 0.15);
    --primary-glow: rgba(0, 229, 184, 0.3);

    /* Status Colors - 다크모드 배경 */
    --success-bg: rgba(0, 212, 170, 0.15);
    --warning-bg: rgba(255, 179, 0, 0.15);
    --danger-bg: rgba(255, 82, 82, 0.15);
    --info-bg: rgba(33, 150, 243, 0.15);

    /* Text Colors - 다크모드 */
    --text-dark: #f5f7fa;
    --text-primary: #e4e7eb;
    --text-secondary: #9aa3ae;
    --text-tertiary: #6b7684;

    /* Background Colors - 다크모드 */
    --bg-body: #0d1117;
    --bg-card: #161b22;
    --bg-light: #1c2128;
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #1c2128;
    --bg-sidebar: linear-gradient(180deg, #0d1117 0%, #010409 100%);
    --bg-sidebar-solid: #0d1117;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
    --bg-topbar: rgba(22, 27, 34, 0.9);
    --bg-hover: #1c2128;
    --bg-input: #0d1117;

    /* Border & Shadow - 다크모드 */
    --border-color: #30363d;
    --border-light: #21262d;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);

    /* Color Scheme */
    color-scheme: dark;
}

/* 시스템 다크모드 설정 따르기 */
@media (prefers-color-scheme: dark) {
    [data-theme="system"] {
        /* Primary Colors */
        --primary: #00E5B8;
        --primary-dark: #00D4AA;
        --primary-light: rgba(0, 212, 170, 0.15);
        --primary-glow: rgba(0, 229, 184, 0.3);

        /* Status Colors */
        --success-bg: rgba(0, 212, 170, 0.15);
        --warning-bg: rgba(255, 179, 0, 0.15);
        --danger-bg: rgba(255, 82, 82, 0.15);
        --info-bg: rgba(33, 150, 243, 0.15);

        /* Text Colors */
        --text-dark: #f5f7fa;
        --text-primary: #e4e7eb;
        --text-secondary: #9aa3ae;
        --text-tertiary: #6b7684;

        /* Background Colors */
        --bg-body: #0d1117;
        --bg-card: #161b22;
        --bg-light: #1c2128;
        --bg-primary: #0d1117;
        --bg-secondary: #161b22;
        --bg-tertiary: #1c2128;
        --bg-sidebar: linear-gradient(180deg, #0d1117 0%, #010409 100%);
        --bg-sidebar-solid: #0d1117;
        --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
        --bg-topbar: rgba(22, 27, 34, 0.9);
        --bg-hover: #1c2128;
        --bg-input: #0d1117;

        /* Border & Shadow */
        --border-color: #30363d;
        --border-light: #21262d;
        --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);

        color-scheme: dark;
    }
}

/* 시스템 라이트모드일 때는 기본 light 변수 사용 */
@media (prefers-color-scheme: light) {
    [data-theme="system"] {
        color-scheme: light;
    }
}

/* 다크모드 추가 스타일 */
[data-theme="dark"] .section-header {
    background: linear-gradient(180deg, rgba(22, 27, 34, 0.5) 0%, transparent 100%);
}

/* 다크모드 topbar 보더 조정 */
[data-theme="dark"] .topbar {
    border-bottom-color: rgba(48, 54, 61, 0.6);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-body);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.mypage-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ==========================================================================
   Sidebar (공통) - Premium Design
   ========================================================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    color: #fff;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-smooth);
    overflow: hidden;
}

/* Sidebar 글로우 효과 */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: radial-gradient(ellipse at top left, rgba(0, 212, 170, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

/* 하단 글로우 */
.sidebar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: radial-gradient(ellipse at bottom right, rgba(0, 180, 216, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform var(--transition-fast);
}

.sidebar-logo:hover {
    transform: translateX(4px);
}

.sidebar-logo span {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

/* 커스텀 스크롤바 */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.nav-section {
    margin-bottom: 28px;
}

.nav-section-title {
    padding: 8px 16px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all var(--transition-smooth);
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
}

/* 호버 배경 애니메이션 */
.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-sidebar-hover);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.nav-item:hover::before {
    opacity: 1;
}

.nav-item:hover {
    color: #fff;
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 212, 170, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-item.active::before {
    display: none;
}

/* 액티브 아이템 글로우 효과 */
.nav-item.active::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    filter: blur(10px);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
    transition: transform var(--transition-fast);
}

.nav-item:hover i {
    transform: scale(1.1);
}

.nav-item span {
    position: relative;
    z-index: 1;
}

.nav-item .badge {
    margin-left: auto;
    padding: 3px 10px;
    background: linear-gradient(135deg, #ff5252, #ff7b7b);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: 12px;
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(255, 82, 82, 0.4);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    transition: all var(--transition-smooth);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.sidebar-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
    position: relative;
}

/* 온라인 상태 표시 */
.sidebar-user-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #4caf50;
    border-radius: 50%;
    border: 2px solid var(--bg-sidebar-solid);
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ==========================================================================
   Main Content (공통)
   ========================================================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ==========================================================================
   Top Bar (공통) - Glassmorphism Design
   ========================================================================== */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: var(--bg-topbar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(229, 232, 235, 0.6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 900;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 1.25rem;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-smooth);
}

.mobile-menu-btn:hover {
    background: var(--bg-hover);
    color: var(--text-dark);
    transform: scale(1.05);
}

.topbar-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 1.125rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-smooth);
}

.topbar-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: scale(1.05);
}

.topbar-btn .notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #ff5252, #ff7b7b);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(255, 82, 82, 0.4);
    animation: pulse-notification 2s ease-in-out infinite;
    display: none; /* 기본 숨김 - JS에서 읽지 않은 알림이 있을 때만 표시 */
}

@keyframes pulse-notification {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.dark-mode-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.dark-mode-toggle i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.dark-mode-toggle:hover i {
    transform: rotate(15deg);
}

.dark-mode-toggle .theme-text {
    display: inline;
}

/* 다크모드 토글 아이콘 색상 */
[data-theme="dark"] .dark-mode-toggle i.fa-moon {
    color: #ffd43b;
}

[data-theme="light"] .dark-mode-toggle i.fa-sun {
    color: #ff9800;
}

.dark-mode-toggle i.fa-desktop {
    color: var(--primary);
}

/* 모바일에서 텍스트 숨기기 */
@media (max-width: 768px) {
    .dark-mode-toggle .theme-text {
        display: none;
    }

    .dark-mode-toggle {
        padding: 10px;
    }
}

/* ==========================================================================
   Page Content Container (공통)
   ========================================================================== */
.page-content {
    flex: 1;
    padding: 32px;
    overflow-x: hidden;
}

/* ==========================================================================
   Common Components - Premium Design
   ========================================================================== */

/* Section Card */
.section-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all var(--transition-smooth);
}

.section-card:hover {
    box-shadow: var(--shadow-md);
}

.section-card--spaced {
    margin-top: 24px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(180deg, rgba(248, 250, 251, 0.5) 0%, transparent 100%);
}

.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--primary);
    font-size: 1.1rem;
}

.section-action {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-smooth);
}

.section-action:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.section-body {
    padding: 24px;
}

.section-body--compact {
    padding: 16px 24px;
}

/* Status Badge - Enhanced */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

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

.status-badge.active {
    background: linear-gradient(135deg, #e8faf6, #d0f5ed);
    color: var(--success);
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.15);
}

.status-badge.active::before {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.status-badge.pending {
    background: linear-gradient(135deg, #fff8e6, #fff0cc);
    color: #e6a000;
    box-shadow: 0 2px 8px rgba(255, 179, 0, 0.15);
}

.status-badge.pending::before {
    background: var(--warning);
    box-shadow: 0 0 6px var(--warning);
}

.status-badge.expired {
    background: linear-gradient(135deg, #ffebee, #ffd6d6);
    color: var(--danger);
    box-shadow: 0 2px 8px rgba(255, 82, 82, 0.15);
}

.status-badge.expired::before {
    background: var(--danger);
    box-shadow: 0 0 6px var(--danger);
}

/* ==========================================================================
   Animations - Enhanced
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.animate-fade-in {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-scale-in {
    animation: fadeInScale 0.4s ease forwards;
}

.animate-slide-in {
    animation: slideInLeft 0.5s ease forwards;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* 스크롤 트리거 애니메이션 (JS와 연동) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 숫자 카운터 애니메이션용 */
.counter-animate {
    display: inline-block;
    transition: all 0.3s ease;
}

/* ==========================================================================
   Responsive Design (공통 레이아웃)
   ========================================================================== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    .page-content {
        padding: 20px 16px;
    }

    .topbar {
        padding: 0 16px;
    }

    .section-header,
    .section-body {
        padding: 16px;
    }

    .section-body--compact {
        padding: 12px 16px;
    }
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast-notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: #333;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    animation: toastIn 0.3s ease forwards;
}

.toast-notification i {
    font-size: 16px;
    color: var(--primary);
}

.toast-notification.error {
    background: #dc3545;
}

.toast-notification.error i {
    color: #fff;
}

.toast-notification.fade-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

/* ==========================================================================
   Notification System
   ========================================================================== */

/* Notification Wrapper */
.notification-wrapper {
    position: relative;
}

.notification-wrapper .topbar-btn.active {
    background: var(--bg-hover);
}

/* Notification Panel */
.notification-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 500px;
    background: var(--bg-card, #fff);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color, #e5e7eb);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.98);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notification-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.notification-panel-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark, #1a1f36);
    margin: 0;
}

.notification-panel-actions {
    display: flex;
    gap: 8px;
}

.notification-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary, #f8fafc);
    border: none;
    border-radius: 8px;
    color: var(--text-tertiary, #9ca3af);
    cursor: pointer;
    transition: all 0.2s;
}

.notification-action-btn:hover {
    background: var(--bg-hover, #f1f5f9);
    color: var(--text-dark, #1a1f36);
}

.notification-panel-body {
    flex: 1;
    overflow-y: auto;
    max-height: 360px;
}

.notification-list {
    padding: 8px;
}

/* Notification Item */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.notification-item:hover {
    background: var(--bg-hover, #f1f5f9);
}

.notification-item.unread {
    background: rgba(0, 212, 170, 0.05);
}

.notification-item.unread:hover {
    background: rgba(0, 212, 170, 0.1);
}

.notification-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
    font-size: 16px;
}

.notification-icon.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.notification-icon.success {
    background: rgba(0, 212, 170, 0.1);
    color: #00D4AA;
}

.notification-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.notification-icon.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.notification-icon.server {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.notification-icon.payment {
    background: rgba(0, 212, 170, 0.1);
    color: #00D4AA;
}

.notification-icon.security {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.notification-icon.system {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.notification-icon.dns {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.notification-icon.ticket {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark, #1a1f36);
    margin: 0 0 4px;
    line-height: 1.4;
}

.notification-message {
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
    margin: 0 0 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 12px;
    color: var(--text-tertiary, #9ca3af);
}

.notification-unread-dot {
    position: absolute;
    top: 16px;
    right: 12px;
    width: 8px;
    height: 8px;
    background: var(--primary, #00D4AA);
    border-radius: 50%;
}

/* Empty State */
.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.notification-empty-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 50%;
    margin-bottom: 16px;
    font-size: 24px;
    color: var(--text-tertiary, #9ca3af);
}

.notification-empty-icon.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.notification-empty p {
    font-size: 14px;
    color: var(--text-secondary, #6b7280);
    margin: 0;
}

.notification-retry-btn {
    margin-top: 12px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary, #00D4AA);
    background: transparent;
    border: 1px solid var(--primary, #00D4AA);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.notification-retry-btn:hover {
    background: var(--primary, #00D4AA);
    color: #fff;
}

.notification-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 12px;
    color: var(--text-tertiary, #9ca3af);
}

.notification-loading i {
    font-size: 24px;
    color: var(--primary, #00D4AA);
}

/* Panel Footer */
.notification-panel-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color, #e5e7eb);
    text-align: center;
}

.view-all-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary, #00D4AA);
    text-decoration: none;
    transition: opacity 0.2s;
}

.view-all-link:hover {
    opacity: 0.8;
}

/* Toast Container (Top Right) */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}

.toast-container .toast-notification {
    position: relative;
    transform: none;
    left: auto;
    bottom: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    min-width: 320px;
    max-width: 400px;
    background: var(--bg-card, #fff);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color, #e5e7eb);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.toast-container .toast-notification.hiding {
    opacity: 0;
    transform: translateX(100%);
}

.toast-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
    font-size: 18px;
}

.toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.toast-success .toast-icon {
    background: rgba(0, 212, 170, 0.1);
    color: #00D4AA;
}

.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.toast-server .toast-icon {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark, #1a1f36);
    margin: 0 0 4px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
    margin: 0;
    line-height: 1.4;
}

.toast-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-tertiary, #9ca3af);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: var(--bg-hover, #f1f5f9);
    color: var(--text-dark, #1a1f36);
}

/* Dark Mode */
[data-theme="dark"] .notification-panel {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .notification-item.unread {
    background: rgba(0, 212, 170, 0.08);
}

[data-theme="dark"] .notification-item.unread:hover {
    background: rgba(0, 212, 170, 0.12);
}

[data-theme="dark"] .toast-container .toast-notification {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .notification-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
    }

    .notification-panel.active {
        transform: translateY(0);
    }

    .toast-container {
        top: auto;
        bottom: 24px;
        right: 16px;
        left: 16px;
    }

    .toast-container .toast-notification {
        min-width: auto;
        max-width: none;
    }
}

/* ==========================================================================
   Pagination - 공통 페이지네이션 스타일
   ========================================================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 24px;
    padding: 16px 0;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.pagination-btn:hover:not(:disabled):not(.active) {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

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

.pagination-btn.pagination-prev,
.pagination-btn.pagination-next {
    font-size: 12px;
}

.pagination-btn.pagination-first,
.pagination-btn.pagination-last {
    font-size: 12px;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: var(--text-tertiary);
    font-size: 14px;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-info select {
    padding: 6px 28px 6px 10px;
    background: var(--bg-card) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7684' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat right 8px center/10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
}

/* 반응형 */
@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }

    .pagination-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 13px;
    }

    .pagination-info {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 12px;
    }

    .pagination-btn.pagination-first,
    .pagination-btn.pagination-last {
        display: none;
    }
}
