/* ==========================================
   ToolMong CSS Design System (Premium Theme)
   ========================================== */

/* 1. CSS Variable Tokens */
:root {
    /* Light Mode Tokens */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --bg-navbar: rgba(255, 255, 255, 0.85);
    --border-color: #e2e8f0;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
    
    /* Category Colors */
    --text-tool-color: #ec4899;
    --dev-tool-color: #10b981;
    --calc-tool-color: #f59e0b;
    --rand-tool-color: #8b5cf6;
    --regex-tool-color: #06b6d4;
    --unit-tool-color: #14b8a6;
}

[data-theme="dark"] {
    /* Dark Mode Tokens */
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    --bg-light: #0b0f19;
    --bg-card: #151f32;
    --bg-navbar: rgba(21, 31, 50, 0.85);
    --border-color: #22314a;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* Global Custom Scrollbar ( 주야간 모드 자동 대응 ) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

html {
    scrollbar-color: var(--border-color) var(--bg-light);
    scrollbar-width: thin;
    scroll-behavior: smooth;
}

/* 2. Global Reset & Base Styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Pretendard', 'Outfit', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 3. Header & Navigation (PC) */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-navbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.4s, border-color 0.4s;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 75px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.brand-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 10px;
    flex-shrink: 0;
}

.logo-icon {
    font-size: 1.6rem;
    color: var(--primary-color);
    transition: transform 0.3s;
}

.brand-logo:hover .logo-icon {
    transform: rotate(20deg);
}

.logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s;
}

.brand-logo:hover .logo-img {
    transform: scale(1.08);
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.brand-text span {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links .nav-divider {
    width: 1px;
    height: 14px;
    background-color: var(--border-color);
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
    padding: 6px 0;
}

.nav-item:hover {
    color: var(--text-color);
}

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

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* User profile badge */
.user-profile-badge {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    height: 38px;
    padding: 0 14px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.25s ease;
}

.user-profile-badge:hover {
    border-color: var(--primary-color);
    background: rgba(96, 165, 250, 0.05);
}

.nickname-txt {
    font-size: 0.85rem;
    font-weight: 700;
}

.nickname-edit-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    transition: color 0.2s;
}

.nickname-edit-btn:hover {
    color: var(--primary-color);
}

/* Theme Toggle Button */
.theme-toggle {
    cursor: pointer;
    width: 38px;
    height: 38px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-navbar);
}

.theme-toggle .toggle-icon-wrapper {
    position: relative;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle .toggle-icon-wrapper i {
    font-size: 1.1rem;
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 라이트 모드일 때 (기본) -> 달 아이콘 표시 */
.theme-toggle .toggle-icon-wrapper .dark-icon {
    color: #f59e0b;
    opacity: 1;
    transform: scale(1) rotate(0);
}

.theme-toggle .toggle-icon-wrapper .light-icon {
    color: #f59e0b;
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}

/* 다크 모드일 때 -> 해 아이콘 표시 */
[data-theme="dark"] .theme-toggle {
    border-color: var(--border-color);
    background-color: var(--bg-navbar);
}

[data-theme="dark"] .theme-toggle .toggle-icon-wrapper .dark-icon {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

[data-theme="dark"] .theme-toggle .toggle-icon-wrapper .light-icon {
    opacity: 1;
    transform: scale(1) rotate(0);
}

/* 클릭 효과: 회전 */
[data-theme="dark"] .theme-toggle .toggle-icon-wrapper {
    transform: rotate(360deg);
}

/* 4. Hero Section */
.hero-section {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: center;
    padding: 60px 0;
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
}

.hero-title span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 35px;
    max-width: 580px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 14px rgba(96, 165, 250, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(96, 165, 250, 0.6);
}

.btn-outline {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--border-color);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.05rem;
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
}

.visual-card-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
}

.visual-card {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    width: 220px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.4s ease-out;
}

.visual-card i {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.visual-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.visual-card span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.visual-card.c1 {
    top: 0;
    left: 0;
    z-index: 3;
    transform: rotate(-8deg);
}

.visual-card.c1 i { color: var(--dev-tool-color); }

.visual-card.c2 {
    bottom: 20px;
    right: 0;
    z-index: 2;
    transform: translate(20px, 0) rotate(5deg);
}

.visual-card.c2 i { color: var(--text-tool-color); }

.visual-card.c3 {
    top: 40px;
    right: -20px;
    z-index: 1;
    transform: translate(40px, -20px) rotate(15deg);
    opacity: 0.7;
}

.visual-card.c3 i { color: var(--calc-tool-color); }

.hero-section:hover .visual-card.c1 { transform: translate(-10px, -5px) rotate(-12deg); }
.hero-section:hover .visual-card.c2 { transform: translate(30px, 5px) rotate(8deg); }

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

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-fade-in-delayed {
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.3s forwards;
}

/* 5. Tools Section */
.tools-section {
    padding: 80px 0;
    border-top: 1px solid var(--border-color);
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.section-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 35px;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 24px;
}

/* Icons category background */
.card-icon.text-tool { background: rgba(236, 72, 153, 0.1); color: var(--text-tool-color); }
.card-icon.dev-tool { background: rgba(16, 185, 129, 0.1); color: var(--dev-tool-color); }
.card-icon.calc-tool { background: rgba(245, 158, 11, 0.1); color: var(--calc-tool-color); }
.card-icon.rand-tool { background: rgba(139, 92, 246, 0.1); color: var(--rand-tool-color); }
.card-icon.regex-tool { background: rgba(6, 182, 212, 0.1); color: var(--regex-tool-color); }
.card-icon.unit-tool { background: rgba(20, 184, 166, 0.1); color: var(--unit-tool-color); }

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 28px;
    flex-grow: 1;
}

.card-link {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s;
}

.card-link:hover {
    gap: 8px;
}

/* 6. Visitor Stats Section */
.visitor-stat-section {
    padding: 40px 0;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background-color: var(--border-color);
}

/* 7. Footer */
footer {
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-card);
    padding: 40px 20px;
    transition: background-color 0.4s;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 20px;
}

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

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

/* 8. Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 35px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.mobile-modal-content {
    max-width: 320px;
    padding: 24px;
    width: 88%;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-content h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.modal-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.modal-content input {
    width: 100%;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.95rem;
    margin-bottom: 24px;
    outline: none;
    transition: border-color 0.2s;
}

.modal-content input:focus {
    border-color: var(--primary-color);
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cancel {
    background: transparent;
    color: var(--text-muted);
    border: none;
}

.btn-cancel:hover {
    color: var(--text-color);
}

/* ==========================================
   Mobile-specific Layout Styles & Media Queries
   ========================================== */

/* 9. Mobile Framework (m_base.html, m_main.html) */
.mobile-body {
    padding-top: 60px; /* space for top header */
    padding-bottom: 70px; /* space for bottom nav */
    background-color: var(--bg-light);
}

.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--bg-navbar);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    z-index: 1000;
}

.mobile-brand-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 8px;
}

.mobile-brand-logo .brand-text {
    font-size: 1.25rem;
}

.mobile-brand-logo .logo-img {
    height: 26px;
    width: auto;
    object-fit: contain;
}

.mobile-header-right {
    display: flex;
    gap: 8px;
}

.mobile-action-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.15rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.mobile-action-btn:hover {
    background-color: var(--border-color);
}

.mobile-main {
    min-height: calc(100vh - 130px);
}

.mobile-container {
    padding: 16px;
}

/* Welcome banner */
.mobile-welcome-banner {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    box-shadow: var(--shadow-sm);
}

/* Mobile Hero */
.mobile-hero {
    margin-bottom: 24px;
}

.mobile-hero h2 {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 8px;
}

.mobile-hero h2 span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mobile-hero p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Mobile Tools List */
.mobile-section-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.mobile-tools-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.mobile-tool-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s;
}

.mobile-tool-item:active {
    background-color: var(--border-color);
}

.mobile-tool-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-right: 14px;
    flex-shrink: 0;
}

.mobile-tool-icon.text-tool { background: rgba(236, 72, 153, 0.1); color: var(--text-tool-color); }
.mobile-tool-icon.dev-tool { background: rgba(16, 185, 129, 0.1); color: var(--dev-tool-color); }
.mobile-tool-icon.calc-tool { background: rgba(245, 158, 11, 0.1); color: var(--calc-tool-color); }
.mobile-tool-icon.rand-tool { background: rgba(139, 92, 246, 0.1); color: var(--rand-tool-color); }
.mobile-tool-icon.regex-tool { background: rgba(6, 182, 212, 0.1); color: var(--regex-tool-color); }
.mobile-tool-icon.unit-tool { background: rgba(20, 184, 166, 0.1); color: var(--unit-tool-color); }

.mobile-tool-info {
    flex-grow: 1;
    min-width: 0; /* flex container 내부에서 자식이 늘어나 레이아웃 침범하는 것 방지 */
}

.mobile-tool-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-tool-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: normal;
    word-break: keep-all;
    line-height: 1.35;
}

.mobile-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Mobile Stats */
.mobile-stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.mobile-stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
}

.mobile-stat-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-stat-col .m-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.mobile-stat-col .m-value {
    font-size: 1rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--primary-color);
}

/* Bottom Nav (Mobile) */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: var(--bg-navbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    gap: 4px;
    width: 25%;
    height: 100%;
    justify-content: center;
    transition: color 0.2s;
}

.nav-tab i {
    font-size: 1.2rem;
}

.nav-tab.active {
    color: var(--primary-color);
}

.nav-tab-avatar-wrapper {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.nav-tab-avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive Overrides (For PCs sizing down) */
@media (max-width: 900px) {
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 40px 0;
    }
    .hero-title {
        font-size: 2.4rem;
    }
    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
    .hero-actions {
        justify-content: center;
    }
    .hero-visual {
        display: none; /* Hide visual on smaller screens */
    }
    .stat-card {
        flex-wrap: wrap;
        gap: 20px;
    }
    .stat-divider {
        display: none;
    }
    .stat-item {
        width: 45%;
    }
}

/* ==========================================
   Avatar & Profile Image Upload Styles
   ========================================== */
.user-avatar-mini {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background-color: var(--bg-light);
    flex-shrink: 0;
}

.user-avatar-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-welcome-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background-color: var(--bg-light);
    margin-right: 10px;
    flex-shrink: 0;
}

.mobile-welcome-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-welcome-banner {
    display: flex;
    align-items: center;
}

.profile-upload-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.avatar-preview-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2.5px solid var(--primary-color);
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.avatar-preview-wrapper:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

.avatar-preview-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder-large {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-muted);
}

.avatar-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.avatar-preview-wrapper:hover .avatar-hover-overlay {
    opacity: 1;
}

/* ==========================================
   Color Code Tool Styles
   ========================================== */
.tool-detail-header {
    margin-bottom: 35px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.tool-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tool-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
}

.color-tool-workspace {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 30px;
    margin-bottom: 40px;
}

.color-converter-card,
.color-palette-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
}

.color-converter-card h3,
.color-palette-card h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.palette-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Preview Box */
.color-preview-box {
    position: relative;
    height: 160px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s;
    background-color: #60a5fa;
}

.color-preview-box:hover {
    transform: scale(1.01);
}

.preview-text {
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.35);
    font-family: 'Outfit', sans-serif;
    z-index: 2;
    pointer-events: none;
}

.color-picker-trigger {
    font-size: 0.85rem;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    margin-top: 6px;
    z-index: 2;
    pointer-events: none;
}

#color-picker-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

/* Inputs */
.color-inputs-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.color-input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.input-with-copy {
    display: flex;
    gap: 10px;
}

.input-with-copy input {
    flex-grow: 1;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 700;
    outline: none;
    transition: border-color 0.2s;
}

.input-with-copy input:focus {
    border-color: var(--primary-color);
}

.btn-copy-code {
    background: var(--primary-gradient);
    border: none;
    color: #ffffff;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(96, 165, 250, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-copy-code:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.5);
}

/* Tabs */
.palette-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.palette-tabs .tab-btn {
    flex-grow: 1;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.palette-tabs .tab-btn:hover {
    color: var(--text-color);
    border-color: var(--primary-color);
}

.palette-tabs .tab-btn.active {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 10px rgba(96, 165, 250, 0.3);
}

/* Grid & Chips */
.palette-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.palette-chip {
    aspect-ratio: 1.2/1;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
}

.palette-chip:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.palette-chip span {
    font-size: 0.8rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Floating Toast */
.copy-toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 3000;
    box-shadow: var(--shadow-lg);
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 900px) {
    .color-tool-workspace {
        grid-template-columns: 1fr;
    }
}/* Mobile Color Tool Spacing Updates */
.mobile-tool-detail-header {
    margin-top: 10px;
    margin-bottom: 25px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-tool-detail-header h3 {
    font-size: 1.45rem;
    font-weight: 800;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-tool-detail-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.mobile-preview-container {
    margin-top: 10px;
    margin-bottom: 25px;
}

/* Language Selector Styles */
/* PC Language Selector Dropdown Styles */
.pc-lang-selector-wrapper {
    position: relative;
    margin-right: 18px;
}

.pc-lang-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    height: 38px;
    padding: 0 14px;
    box-sizing: border-box;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    color: var(--text-color);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pc-lang-dropdown-btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-navbar);
}

.pc-lang-dropdown-btn.active {
    border-color: var(--primary-color);
    background: var(--bg-navbar);
}

.pc-lang-dropdown-btn .lang-icon {
    font-size: 0.9rem;
    color: var(--primary-color);
}

.pc-lang-dropdown-btn .arrow-icon {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.pc-lang-dropdown-btn.active .arrow-icon {
    transform: rotate(180deg);
}

.pc-lang-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-navbar);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    width: 140px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    z-index: 1005;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.pc-lang-dropdown-panel.active {
    display: flex !important;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.lang-dropdown-item {
    background: transparent;
    border: none;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-color);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.lang-dropdown-item:hover {
    background: var(--bg-light);
}

.lang-dropdown-item.active {
    color: var(--primary-color);
    background: rgba(96, 165, 250, 0.08);
}

.lang-dropdown-item .lang-code {
    font-size: 0.68rem;
    opacity: 0.6;
}

.lang-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 6px;
}

/* Inline Canvas Color Picker layout */
.inline-picker-container {
    width: 100%;
    margin-bottom: 24px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    background: var(--bg-light);
    touch-action: none; /* Prevent scroll on mobile drag */
}

#inline-picker-canvas {
    display: block;
    width: 100%;
    height: 150px;
    cursor: crosshair;
}

/* Favorite Button & My Tools Styles */
.tool-card {
    position: relative; /* fav-btn 배치를 위해 부모 relative 지정 */
}

.fav-container {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: auto;
}

.fav-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: color 0.2s, transform 0.2s, opacity 0.2s;
    opacity: 0.6;
    padding: 5px;
}

.fav-btn:hover {
    transform: scale(1.2);
    opacity: 1;
}

.fav-btn.active {
    color: #ffb020;
    opacity: 1;
}

.fav-count {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-color);
    user-select: none;
    transition: all 0.2s;
}

.fav-container.active .fav-count {
    color: var(--text-color);
}

/* My Tools Empty Card */
.my-tools-empty-card {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    text-align: center;
    color: var(--text-muted);
    transition: background-color 0.3s;
}

.my-tools-empty-card i {
    font-size: 2.5rem;
    color: var(--border-color);
    margin-bottom: 12px;
}

.my-tools-empty-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.my-tools-empty-card strong {
    color: var(--text-color);
}

/* Mobile Fav Styles */
.mobile-tool-item {
    position: relative;
    padding-right: 80px !important; /* 화살표와 즐겨찾기 공간 확보 */
}

.mobile-tool-fav-wrapper {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px;
}

.mobile-tool-fav-wrapper.active .fav-count {
    color: var(--text-muted);
}

.mobile-tool-fav-wrapper .fav-count {
    font-size: 0.72rem;
    margin-top: -4px;
    color: var(--text-muted);
    opacity: 0.7;
}

.mobile-fav-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.15rem;
    color: var(--text-muted);
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}

.mobile-fav-btn.active {
    color: #ffb020;
}

.mobile-my-tools-section {
    margin-bottom: 24px;
}

.mobile-my-tools-empty {
    padding: 24px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.mobile-my-tools-empty i {
    font-size: 1.8rem;
    color: var(--border-color);
    margin-bottom: 8px;
    display: block;
}

/* Search & Autocomplete Styles */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto 30px auto;
    width: 100%;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 0 20px;
    height: 54px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.search-icon {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-right: 12px;
    transition: color 0.3s;
}

.search-box:focus-within .search-icon {
    color: var(--primary-color);
}

#tool-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 1rem;
    font-family: inherit;
    width: 100%;
}

#tool-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

#search-clear-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 5px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

#search-clear-btn:hover {
    color: var(--text-color);
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card, #151f32);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 100;
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 0;
    backdrop-filter: blur(10px);
}

/* 라이트 모드일 때 투명도 조절 */
[data-theme="light"] .autocomplete-dropdown {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.autocomplete-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    gap: 12px;
}

.autocomplete-item:hover, .autocomplete-item.active {
    background: rgba(96, 165, 250, 0.1);
}

.autocomplete-item i {
    font-size: 1.1rem;
    color: var(--primary-color);
    width: 24px;
    text-align: center;
}

.autocomplete-item-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.autocomplete-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
}

.autocomplete-item-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.autocomplete-no-match {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Mobile Search Styles */
.mobile-search-container {
    padding: 0 16px;
    margin-bottom: 20px;
}

.mobile-search-box {
    height: 46px;
    padding: 0 16px;
    border-radius: 23px;
}

.mobile-search-box #tool-search-input {
    font-size: 0.9rem;
}

/* Detail Page Favorite Button */
.detail-fav-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    vertical-align: middle;
    margin-left: 12px;
}

.detail-fav-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: color 0.2s, transform 0.2s;
    padding: 0 4px;
}

.detail-fav-btn:hover {
    transform: scale(1.2);
}

.detail-fav-btn.active {
    color: #ffb020;
}

@media (max-width: 768px) {
    .detail-fav-btn {
        font-size: 1.3rem;
        padding: 4px 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        vertical-align: middle;
    }
}

.detail-fav-container.active .fav-count {
    color: var(--text-color);
}

/* Global Header Search Styles (Desktop) */
.header-search-container {
    position: relative;
    flex: 1 1 auto;
    max-width: 320px;
    min-width: 120px;
    margin: 0 20px;
}

.header-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0 14px;
    height: 38px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.header-search-box:focus-within {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15);
    max-width: 360px; /* Focus 시 소폭 넓어지는 고급 연출 */
}

.header-search-icon {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-right: 8px;
}

.header-search-box:focus-within .header-search-icon {
    color: var(--primary-color);
}

#global-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 0.88rem;
    font-family: inherit;
    width: 100%;
}

#global-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

#global-search-clear-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 3px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

#global-search-clear-btn:hover {
    color: var(--text-color);
}

.global-autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card, #151f32);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px 0;
    backdrop-filter: blur(10px);
}

[data-theme="light"] .global-autocomplete-dropdown {
    background: rgba(255, 255, 255, 0.96);
}

/* Mobile Global Search Styles */
.mobile-global-search-container {
    position: relative;
    flex-grow: 1;
    z-index: 1100;
    margin-left: 12px;
    margin-right: 8px;
}

.mobile-global-search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card, #151f32);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0 12px;
    height: 40px;
    gap: 8px;
    box-shadow: var(--shadow-md);
}

[data-theme="light"] .mobile-global-search-box {
    background: #ffffff;
}

.mobile-global-search-box .search-icon {
    font-size: 0.95rem;
    color: var(--primary-color);
}

#global-search-input-mobile {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 0.9rem;
    width: 100%;
}

#global-search-clear-btn-mobile, #mobile-search-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: 4px;
    display: flex;
    align-items: center;
}

#mobile-search-close-btn {
    border-left: 1px solid var(--border-color);
    padding-left: 8px;
    margin-left: 4px;
    color: var(--text-muted);
}

.global-autocomplete-dropdown.mobile-dropdown {
    top: calc(100% + 4px);
    border-radius: 12px;
    max-height: 250px;
}

/* List Controls & Pagination Styles */
.list-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.sort-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-selector label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
}

.sort-selector select {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-color);
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.sort-selector select:focus {
    border-color: var(--primary-color);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    gap: 8px;
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 6px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(96, 165, 250, 0.05);
}

.page-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

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

/* Mobile Controls */
.mobile-list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    margin-bottom: 12px;
}

.mobile-list-controls h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.mobile-sort-selector select {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--text-color);
    font-size: 0.8rem;
    outline: none;
}

/* Drag and Drop premium active styling */
.tool-card.dragging {
    opacity: 0.4;
    border: 2px dashed var(--primary-color) !important;
    transform: scale(0.98);
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    z-index: 100;
}

.mobile-tool-item.dragging {
    opacity: 0.5;
    background: rgba(255,255,255,0.05) !important;
    border: 1px dashed var(--primary-color) !important;
    transform: scale(0.98);
}

/* Shuffle button for random sort */
#tools-shuffle-btn, #mobile-tools-shuffle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    transition: color 0.2s, transform 0.3s ease;
}

#tools-shuffle-btn:hover, #mobile-tools-shuffle-btn:hover {
    color: var(--text-color);
    transform: rotate(180deg);
}

/* ==========================================
   Breadcrumb Styles
   ========================================== */
.breadcrumb-container {
    margin-bottom: 24px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 500;
}

.breadcrumb-item {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb-item:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-color);
    font-weight: 700;
    pointer-events: none;
}

.breadcrumb-separator {
    color: var(--border-color);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
}

.mobile-breadcrumb {
    padding: 10px 14px;
    margin: 10px 0 20px 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
}

.mobile-breadcrumb .breadcrumb-nav {
    font-size: 0.8rem;
}

/* ==========================================
   Sitemap Menu Panel Styles (Desktop)
   ========================================== */
.sitemap-menu-section {
    background: rgba(255, 255, 255, 0.01);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 50px 0;
    margin-top: 60px;
}

.sitemap-menu-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.sitemap-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
}

.sitemap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 30px;
}

.sitemap-category-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sitemap-category-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.sitemap-cat-icon {
    font-size: 0.95rem;
}

.sitemap-tool-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sitemap-tool-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 4px 0;
}

.sitemap-tool-link:hover, .sitemap-tool-link.active {
    color: var(--text-color);
    padding-left: 4px;
}

.sitemap-tool-link.active {
    font-weight: 700;
    color: var(--primary-color);
}

.sitemap-tool-link .mini-icon {
    font-size: 0.8rem;
    opacity: 0.7;
    width: 16px;
    text-align: center;
}

/* ==========================================
   Mobile Sitemap Menu Styles
   ========================================== */
.mobile-sitemap-section {
    padding: 30px 16px;
    margin-top: 40px;
    margin-bottom: 80px; /* bottom navigation space */
    border-top: 1px solid var(--border-color);
    background: transparent;
}

.mobile-sitemap-section .sitemap-title {
    font-size: 1.15rem;
    margin-bottom: 16px;
}

.sitemap-accordion-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-sitemap-details {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.mobile-sitemap-details[open] {
    border-color: var(--primary-color);
}

.mobile-sitemap-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-color);
    cursor: pointer;
    list-style: none; /* remove default arrow */
}

.mobile-sitemap-summary::-webkit-details-marker {
    display: none; /* remove default arrow for Safari */
}

.mobile-sitemap-summary span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-sitemap-summary .arrow-icon {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.mobile-sitemap-details[open] .mobile-sitemap-summary .arrow-icon {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.mobile-sitemap-list {
    padding: 10px 18px 18px 18px;
    border-top: 1px solid var(--border-color);
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-sitemap-list .sitemap-tool-link {
    font-size: 0.85rem;
    padding: 6px 0;
}

/* ==========================================
   Header Dropdown & Mega Panel Styles (Desktop)
   ========================================== */
.nav-dropdown-wrapper {
    position: relative;
    margin-left: 24px;
    height: 100%;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-dropdown-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-color);
    font-size: 0.88rem;
    font-weight: 700;
    height: 38px;
    padding: 0 16px;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
}

/* Suggestion Menu Button */
.suggestion-menu-btn {
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    box-sizing: border-box;
    border-radius: 8px;
    background: rgba(96, 165, 250, 0.08);
    transition: background 0.2s;
}

.suggestion-menu-btn:hover {
    background: rgba(96, 165, 250, 0.15);
}

.nav-dropdown-btn:hover {
    border-color: var(--primary-color);
    background: rgba(96, 165, 250, 0.05);
}

.nav-menu-icon {
    font-size: 0.9rem;
}

.nav-arrow-icon {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.nav-dropdown-wrapper:hover .nav-arrow-icon {
    transform: rotate(180deg);
    color: var(--primary-color);
}

/* Mega dropdown panel */
.nav-mega-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 780px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
    padding: 24px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.nav-mega-panel::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}

[data-theme="light"] .nav-mega-panel {
    background: #ffffff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.nav-dropdown-wrapper:hover .nav-mega-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.mega-panel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.mega-category-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mega-column-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.mega-column-list {
    list-style: none;
    padding: 0 4px 0 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

/* Custom Scrollbars for columns */
.mega-column-list::-webkit-scrollbar,
.drawer-tool-links::-webkit-scrollbar {
    width: 4px;
}

.mega-column-list::-webkit-scrollbar-track,
.drawer-tool-links::-webkit-scrollbar-track {
    background: transparent;
}

.mega-column-list::-webkit-scrollbar-thumb,
.drawer-tool-links::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.mega-column-list::-webkit-scrollbar-thumb:hover,
.drawer-tool-links::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.mega-tool-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 2px 0;
}

.mega-tool-link:hover, .mega-tool-link.active {
    color: var(--text-color);
    padding-left: 4px;
}

.mega-tool-link.active {
    color: var(--primary-color);
    font-weight: 700;
}

.mega-tool-link .link-mini-icon {
    font-size: 0.75rem;
    width: 14px;
    text-align: center;
    opacity: 0.7;
}

.mega-panel-footer {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.mega-panel-tip {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ==========================================
   Mobile Side Drawer Styles
   ========================================== */
.mobile-drawer-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.25rem;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-drawer-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: var(--bg-navbar);
    border-right: 1px solid var(--border-color);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
    box-shadow: none;
}

.mobile-drawer-menu.active {
    transform: translateX(0);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.3);
}

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

.drawer-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 4px;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.drawer-section-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.drawer-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drawer-categories-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.drawer-category-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-category-name {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.drawer-cat-icon {
    color: var(--primary-color) !important;
}

/* 사이드 드로어 메뉴 아이콘 일괄 정렬 스타일 */
.drawer-section-title i,
.drawer-category-name i,
.drawer-category-box a i,
.drawer-menu-item i,
.drawer-tool-mini-icon {
    width: 24px;
    min-width: 24px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.drawer-tool-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 160px;
    overflow-y: auto;
}

.drawer-tool-link {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.drawer-tool-link:hover {
    color: var(--text-color);
    background-color: var(--bg-light);
}

.drawer-tool-link.active {
    color: var(--primary-color) !important;
    background-color: rgba(96, 165, 250, 0.08);
    font-weight: 700;
}

.drawer-tool-mini-icon {
    font-size: 0.8rem;
    opacity: 0.7;
}

.drawer-fav-badge {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    opacity: 0.8;
}

/* ==========================================
   Tools Directory Page Styles (Desktop)
   ========================================== */
.tools-directory-section {
    padding: 40px 0;
}

.directory-header {
    text-align: center;
    margin-bottom: 50px;
}

.directory-main-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--text-color);
}

.directory-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 850px;
    margin: 0 auto;
    width: 100%;
}

/* 3열 다중 열(Masonry) 레이아웃 배치 */
.directory-categories-grid {
    column-count: 3;
    column-gap: 32px;
    width: 100%;
}

@media (max-width: 1024px) {
    .directory-categories-grid {
        column-count: 2;
        column-gap: 24px;
    }
}

@media (max-width: 768px) {
    .directory-categories-grid {
        column-count: 1;
        column-gap: 0;
    }
}

.directory-category-block {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 32px;
    break-inside: avoid;
    display: inline-flex;
    width: 100%;
}

.directory-category-header {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin: 0;
}

.block-cat-icon {
    color: var(--primary-color);
}

/* 게시판 테이블 스타일 */
.board-list-wrapper {
    width: 100%;
    overflow-x: auto;
}

.board-list-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.board-tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.board-tr:hover {
    background-color: rgba(96, 165, 250, 0.05);
}

.board-list-table td {
    padding: 14px 12px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

[data-theme="light"] .board-list-table td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.td-title {
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    width: 80%;
}

.td-icon {
    font-size: 0.9rem;
    color: var(--primary-color);
    width: 18px;
    text-align: center;
}

.td-favorites {
    text-align: right;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Outfit', sans-serif;
    width: 20%;
    white-space: nowrap;
}

.td-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 30px 0 !important;
}

/* ==========================================
   Tools Directory Page Styles (Mobile)
   ========================================== */
.mobile-directory-section {
    padding: 20px 16px;
}

.mobile-directory-header {
    margin-bottom: 24px;
}

.mobile-directory-header h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-directory-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

.mobile-directory-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mobile-category-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-category-block-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.mobile-board-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
}

.mobile-board-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-color);
    transition: background-color 0.2s;
}

.mobile-board-item:last-child {
    border-bottom: none;
}

.mobile-board-item:active {
    background-color: rgba(96, 165, 250, 0.05);
}

.mb-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
    overflow: hidden;
}

.mb-item-icon {
    font-size: 0.95rem;
    color: var(--primary-color);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.mb-item-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mb-item-title {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.mb-item-right {
    flex-shrink: 0;
}

.mobile-fav-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* ==========================================
   NSLookup DNS Lookup Tool Styles (Desktop)
   ========================================== */
.lookup-form-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.input-group-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.input-field-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.input-field-box.type-select-box {
    flex-grow: 0;
    width: 200px;
}

.field-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-color);
}

.input-text-field, .input-select-field {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-color);
    font-size: 0.9rem;
    padding: 12px 16px;
    outline: none;
    transition: border-color 0.25s ease;
    width: 100%;
}

.input-text-field:focus, .input-select-field:focus {
    border-color: var(--primary-color);
}

.btn-lookup-action {
    height: 48px;
    padding: 0 24px;
    border-radius: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.lookup-error-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    color: #ef4444;
    padding: 16px 20px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.lookup-error-box.hidden {
    display: none;
}

.lookup-result-section {
    margin-top: 24px;
}

.lookup-result-section.hidden {
    display: none;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.result-card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-clear-results {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear-results:hover {
    color: var(--text-color);
    border-color: var(--text-color);
}

.result-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.result-dns-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.result-dns-table th {
    background: rgba(255, 255, 255, 0.02);
    padding: 14px 24px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .result-dns-table th {
    background: rgba(0, 0, 0, 0.01);
}

.result-dns-table td {
    padding: 16px 24px;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

[data-theme="light"] .result-dns-table td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.result-dns-table tr:last-child td {
    border-bottom: none;
}

.td-dns-name {
    font-weight: 600;
    color: var(--text-color);
    word-break: break-all;
}

.td-dns-type {
    text-align: center;
}

.td-dns-ttl {
    text-align: center;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
}

.td-dns-data {
    color: var(--text-muted);
    word-break: break-all;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    font-family: 'Outfit', sans-serif;
}

.badge-a { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-aaaa { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.badge-cname { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-mx { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.badge-txt { background: rgba(99, 102, 241, 0.15); color: #6366f1; }
.badge-ns { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.badge-soa { background: rgba(217, 70, 239, 0.15); color: #d946ef; }

/* ==========================================
   NSLookup DNS Lookup Tool Styles (Mobile)
   ========================================== */
.mobile-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.mb-input-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mb-input-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-color);
}

.mb-text-input, .mb-select-input {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-color);
    font-size: 0.88rem;
    padding: 10px 14px;
    outline: none;
    width: 100%;
}

.mb-submit-btn {
    background: var(--primary-color);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.m-lookup-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 10px;
    color: #ef4444;
    padding: 12px 16px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.m-lookup-error.hidden {
    display: none;
}

.m-lookup-results.hidden {
    display: none;
}

.m-result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.m-result-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.m-result-header h5 {
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0;
}

.m-btn-clear {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 8px;
}

.m-records-list-wrapper {
    display: flex;
    flex-direction: column;
}

.m-dns-item-row {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.m-dns-item-row:last-child {
    border-bottom: none;
}

.m-dns-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.m-dns-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
}

.m-dns-ttl {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
}

.m-dns-item-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-color);
    word-break: break-all;
}

.m-dns-item-data {
    font-size: 0.78rem;
    color: var(--text-muted);
    word-break: break-all;
    font-family: 'Courier New', Courier, monospace;
    background: rgba(255, 255, 255, 0.01);
    padding: 6px 8px;
    border-radius: 6px;
}

/* ==========================================
   Multi-Unit Converter Tool Styles (Desktop)
   ========================================== */
.unit-tabs-wrapper {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.unit-tab-btn {
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.unit-tab-btn:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .unit-tab-btn:hover {
    background: rgba(0, 0, 0, 0.02);
}

.unit-tab-btn.active {
    background: var(--primary-color);
    color: white;
}

.unit-converter-cards-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 35px;
}

.converter-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-field-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-field-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-color);
}

.card-input-number, .card-select-unit {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 700;
    padding: 14px 18px;
    outline: none;
    transition: border-color 0.25s;
    width: 100%;
}

.card-input-number:focus, .card-select-unit:focus {
    border-color: var(--primary-color);
}

.card-input-number.read-only {
    background: rgba(255, 255, 255, 0.01);
    cursor: default;
    border-color: var(--border-color);
}

[data-theme="light"] .card-input-number.read-only {
    background: rgba(0, 0, 0, 0.01);
}

.btn-swap-units {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.btn-swap-units:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: rotate(180deg);
}

.btn-swap-units.no-rotate:hover {
    transform: none;
}

.btn.no-rotate:hover {
    transform: none;
}

.unit-summary-section {
    margin-top: 35px;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.summary-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.summary-header h4 {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
}

.summary-table th {
    background: rgba(255, 255, 255, 0.01);
    padding: 12px 24px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
}

[data-theme="light"] .summary-table th {
    background: rgba(0, 0, 0, 0.01);
}

.summary-table td {
    padding: 14px 24px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .summary-table td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.summary-table tr:last-child td {
    border-bottom: none;
}

.td-summary-name {
    font-weight: 700;
    color: var(--text-color);
}

.td-summary-value {
    text-align: right;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Outfit', sans-serif;
}

.summary-symbol {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-left: 4px;
    font-weight: 500;
}

/* ==========================================
   Multi-Unit Converter Tool Styles (Mobile)
   ========================================== */
.m-unit-tabs-wrapper {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 20px;
    scrollbar-width: none; /* Firefox */
}

.m-unit-tabs-wrapper::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.m-unit-tab-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 10px 16px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.m-unit-tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.m-unit-converter-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.m-converter-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.m-card-input-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.m-card-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-color);
}

.m-card-input-field, .m-card-select-field {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 10px 14px;
    outline: none;
    width: 100%;
}

.m-card-input-field.read-only {
    background: rgba(255, 255, 255, 0.01);
}

[data-theme="light"] .m-card-input-field.read-only {
    background: rgba(0, 0, 0, 0.01);
}

.m-swap-button-row {
    display: flex;
    justify-content: center;
}

.m-btn-swap-action {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

.m-unit-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.m-summary-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.m-summary-header h6 {
    font-size: 0.9rem;
    font-weight: 800;
    margin: 0;
}

.m-summary-table-wrapper {
    width: 100%;
}

.m-summary-table-list {
    width: 100%;
    border-collapse: collapse;
}

.m-summary-row td {
    padding: 12px 16px;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .m-summary-row td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.m-summary-row:last-child td {
    border-bottom: none;
}

.m-td-name {
    font-weight: 700;
    color: var(--text-color);
}

.m-td-value {
    text-align: right;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Outfit', sans-serif;
}

.m-sym {
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-left: 2px;
}

/* ==========================================
   Global Select & Option Accessibility Colors for Theme Switching
   ========================================== */
/* Default Dark Mode Option Colors */
select option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

/* Light Mode Option Colors */
[data-theme="light"] select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

/* 야간모드에서 콤보(Select) 클릭 시 브라우저 기본 흰색 배경 번쩍임(Flicker) 차단 패치 */
select, input {
    color-scheme: dark;
    -webkit-tap-highlight-color: transparent;
}

[data-theme="light"] select, [data-theme="light"] input {
    color-scheme: light;
}

select:focus, select:active {
    background-color: var(--bg-body) !important;
    color: var(--text-color) !important;
    outline: none !important;
}

[data-theme="light"] select:focus, [data-theme="light"] select:active {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

/* ==========================================
   QR Code Reader Tool Styles (Desktop)
   ========================================== */
.qr-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.camera-control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.camera-select-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0 16px;
    height: 48px;
}

.camera-select-wrapper select {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 700;
    outline: none;
    cursor: pointer;
    padding-right: 10px;
}

.scanner-viewfinder-wrapper {
    position: relative;
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.scanner-viewfinder {
    width: 100%;
    height: 100%;
}

.scanner-viewfinder video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.viewfinder-placeholder-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    padding: 30px;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2;
}

.viewfinder-placeholder-overlay i {
    margin-bottom: 16px;
    color: var(--primary-color);
}

.viewfinder-placeholder-overlay p {
    font-size: 0.9rem;
    margin: 0;
}

.file-drag-area {
    border: 2px dashed var(--border-color);
    border-radius: 20px;
    padding: 50px 30px;
    text-align: center;
    background: rgba(255, 255, 255, 0.005);
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

[data-theme="light"] .file-drag-area {
    background: rgba(0, 0, 0, 0.005);
}

.file-drag-area:hover, .file-drag-area.drag-hover {
    border-color: var(--primary-color);
    background: rgba(16, 185, 129, 0.02);
}

.file-drag-area i {
    color: var(--primary-color);
}

.file-drag-area p {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
}

.file-name-label {
    font-size: 0.82rem;
    color: var(--primary-color);
    font-weight: 700;
    word-break: break-all;
}

.qr-result-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.qr-result-textarea {
    width: 100%;
    min-height: 120px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 0.95rem;
    padding: 16px;
    resize: none;
    outline: none;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color 0.25s;
}

.qr-result-textarea:focus {
    border-color: var(--primary-color);
}

.qr-action-buttons-row {
    display: flex;
    gap: 12px;
}

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

/* ==========================================
   Compound Interest Calculator Tool Styles
   ========================================== */
.currency-input-wrapper input {
    padding-right: 40px !important;
}

.ratio-progress-bar {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.comparison-item {
    background: rgba(255, 255, 255, 0.008);
    border-radius: 8px;
    padding: 10px;
    box-shadow: var(--shadow-xs);
}

[data-theme="light"] .comparison-item {
    background: rgba(0, 0, 0, 0.008);
}

/* ==========================================
   My IP Address Checker Tool Styles
   ========================================== */
.ip-mega-display-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(6, 182, 212, 0.08));
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 35px 24px;
    text-align: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.ip-mega-display-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.15);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 182, 212, 0.12));
}

.ip-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--primary-color);
    background: rgba(16, 185, 129, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    text-transform: uppercase;
}

.ip-address-text {
    font-size: 3rem;
    font-weight: 900;
    color: var(--text-color);
    margin: 18px 0 10px 0;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -1px;
}

.ip-click-copy-tip {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Mobile Language Selector Popover Styles */
.mobile-lang-popover {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-navbar);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    width: 160px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 1005;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.mobile-lang-popover.active {
    display: flex !important;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.lang-popover-item {
    background: transparent;
    border: none;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.lang-popover-item:active {
    background: var(--border-color);
}

.lang-popover-item.active {
    color: var(--primary-color);
}

.lang-popover-item .lang-code {
    font-size: 0.72rem;
    opacity: 0.6;
}

.lang-popover-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 8px;
}

/* Mobile global icon spacing helper */
.mobile-body i[class*="fa-"] {
    margin-right: 8px !important;
}

/* Reset margin for standalone icons or specific layouts */
.mobile-body .nav-tab i,
.mobile-body .mobile-fav-btn i,
.mobile-body .drawer-close-btn i,
.mobile-body .breadcrumb-separator i,
.mobile-body .avatar-placeholder-large i,
.mobile-body .avatar-hover-overlay i,
.mobile-body .mobile-arrow,
.mobile-body #mobile-tools-shuffle-btn i,
.mobile-body #global-search-clear-btn-mobile i {
    margin-right: 0 !important;
}

/* Mobile Bottom Nav Theme Toggle Styles */
.mobile-theme-toggle .toggle-icon-wrapper {
    position: relative;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 4px;
}

.mobile-theme-toggle .toggle-icon-wrapper i {
    font-size: 1.25rem;
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
    margin-right: 0 !important;
}

/* 라이트 모드일 때 (기본) -> 달 아이콘 표시 */
.mobile-theme-toggle .toggle-icon-wrapper .dark-icon {
    color: #f59e0b;
    opacity: 1;
    transform: scale(1) rotate(0);
}

.mobile-theme-toggle .toggle-icon-wrapper .light-icon {
    color: #f59e0b;
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}

/* 다크 모드일 때 -> 해 아이콘 표시 */
[data-theme="dark"] .mobile-theme-toggle .toggle-icon-wrapper .dark-icon {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

[data-theme="dark"] .mobile-theme-toggle .toggle-icon-wrapper .light-icon {
    opacity: 1;
    transform: scale(1) rotate(0);
}

/* 클릭 효과: 회전 */
[data-theme="dark"] .mobile-theme-toggle .toggle-icon-wrapper {
    transform: rotate(360deg);
}

