/* Clean White 4-Column Top 10 Link Directory Design System */
:root {
    --bg-main: #f8fafc;
    --bg-header: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    
    --border-card: #e2e8f0;
    --border-header: #cbd5e1;
    
    --text-dark: #0f172a;
    --text-sub: #475569;
    --text-muted: #64748b;
    
    /* Rank Colors */
    --rank-1-color: #e11d48; /* Rose Pink */
    --rank-2-color: #059669; /* Emerald */
    --rank-3-color: #2563eb; /* Royal Blue */
    --rank-4-color: #7c3aed; /* Purple */
    --rank-5-color: #0891b2; /* Cyan */
    --rank-6-color: #1e293b; /* Dark Slate */
    --rank-7-color: #475569; /* Slate */
    --rank-8-color: #d97706; /* Amber */
    --rank-9-color: #c026d3; /* Magenta */
    --rank-10-color: #0f172a; /* Black */

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-active: 0 6px 16px rgba(239, 68, 68, 0.35);
    
    --radius-card: 14px;
    --radius-pill: 9999px;
    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
}

/* Header */
.app-header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-card);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    padding: 12px 0;
}

.header-container {
    max-width: 1520px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.5px;
    text-decoration: none;
    transition: var(--transition);
}

.logo-area:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: transparent !important;
    color: inherit;
    border-radius: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

.logo-text span {
    color: #ef4444;
}

/* Search & Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 420px;
}

.search-box input {
    width: 100%;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 8px 14px 8px 36px;
    border-radius: var(--radius-pill);
    font-size: 0.88rem;
    color: var(--text-dark);
    outline: none;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box input:focus {
    background: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
}

.clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
}

.btn-subtle-nav {
    color: #2563eb;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: 8px;
    background: #eff6ff;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-subtle-nav:hover {
    background: #dbeafe;
}

.btn-subtle-auth {
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 8px 12px;
}

.btn-subtle-auth:hover {
    color: #0f172a;
}

.btn-primary {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

/* Notice Bar */
.notice-bar {
    background: #fffbebf5;
    border-bottom: 1px solid #fef3c7;
    padding: 8px 24px;
    font-size: 0.85rem;
    color: #b45309;
}

.notice-container {
    max-width: 1560px;
    margin: 0 auto;
}

.text-amber { color: #f59e0b; }
.text-rose { color: #f43f5e; }
.text-blue { color: #3b82f6; }
.text-emerald { color: #10b981; }

/* 8 Hero Feature Banner Widgets Grid Section (2 Rows x 4 Columns) */
.hero-widgets-section {
    max-width: 1560px;
    margin: 20px auto 0;
    padding: 0 20px;
}

.hero-widgets-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1360px) {
    .hero-widgets-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .hero-widgets-container {
        grid-template-columns: 1fr;
    }
}

.hero-widget-card {
    background: #ffffff;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    height: 250px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition);
}

.hero-widget-card.draggable-admin {
    cursor: grab;
    user-select: none;
}

.hero-widget-card.draggable-admin:active {
    cursor: grabbing;
}

.drag-grip-icon {
    color: #94a3b8;
    margin-right: 6px;
    font-size: 0.82rem;
    cursor: grab;
    transition: var(--transition);
}

.drag-grip-icon:hover {
    color: #ef4444;
}

.hero-widget-card.dragging {
    opacity: 0.4;
    transform: scale(0.96);
    border: 2px dashed #ef4444 !important;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.25) !important;
}

.hero-widget-card.drag-over {
    border: 2px solid #ef4444 !important;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.35) !important;
    background: #fff5f5 !important;
}

.hero-widget-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.hero-widget-header {
    padding: 10px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.88rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #0f172a;
}

.widget-more-link {
    font-size: 0.76rem;
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
}

.widget-more-link:hover {
    color: #ef4444;
}

.hero-widget-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    overflow: hidden;
}

/* Slot 1: Notice */
.hero-notice-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}

.hero-notice-desc {
    font-size: 0.84rem;
    color: #64748b;
    line-height: 1.4;
}

.hero-widget-link {
    color: #ef4444;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Slot 2: Video Embed */
.video-body {
    padding: 6px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.video-container {
    width: 100%;
    height: 100%;
    min-height: 195px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    position: relative;
}

.video-thumb-overlay {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
}

.video-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.video-thumb-overlay:hover .video-thumb-img {
    transform: scale(1.04);
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: transparent;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
    transition: all 0.22s ease;
}

.video-play-btn svg {
    display: block;
}

.video-thumb-overlay:hover .video-play-btn {
    transform: translate(-50%, -50%) scale(1.15);
    filter: drop-shadow(0 6px 18px rgba(255, 0, 0, 0.5));
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Slot 3: Today's Pick */
.pick-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.pick-favicon {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: contain;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
    background-color: #ffffff;
}

.pick-badge {
    font-size: 0.72rem;
    font-weight: 800;
    color: #d97706;
    background: #fef3c7;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 4px;
}

.pick-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.pick-desc {
    font-size: 0.8rem;
    color: #64748b;
}

.btn-pick-visit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    margin-top: auto;
}

.btn-pick-visit:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

/* Slot 4: Free Board Latest Posts */
.free-posts-body {
    padding: 12px 14px;
}

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

.free-post-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.86rem;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    border-bottom: 1px dashed #f1f5f9;
    padding-bottom: 6px;
    transition: var(--transition);
}

.free-post-link:hover {
    color: #ef4444;
}

.post-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 78%;
}

.post-date {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Slot 5 & 6: Comfortable Spaced Clickable Market Ticker */
.live-pulse-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: #ef4444;
    background: #fee2e2;
    padding: 2px 7px;
    border-radius: 9999px;
    font-weight: 800;
}

.btn-stock-gear {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.btn-stock-gear:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.pulse {
    animation: pulse 1.5s infinite;
}

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

.market-body {
    padding: 4px 10px;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.custom-scroll::-webkit-scrollbar {
    width: 4px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 9999px;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #ef4444;
}

.market-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 0;
    border-bottom: 1px dashed #f1f5f9;
}

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

.market-link {
    text-decoration: none;
    color: inherit;
    padding: 3px 6px;
    border-radius: 6px;
    transition: var(--transition);
}

.market-link:hover {
    background-color: #f1f5f9;
    transform: translateX(3px);
}

.market-info {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.83rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.market-price-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
    gap: 1px;
}

.market-price {
    font-size: 0.84rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 0px;
}

.market-change {
    font-size: 0.71rem;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 1px;
}

.market-change.up {
    color: #059669;
}

.market-change.down {
    color: #dc2626;
}

/* Slot 7: Weekly Trending Top 3 */
.trending-body {
    padding: 10px 14px;
    max-height: 210px;
    overflow-y: auto;
}

.trending-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trending-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 6px 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.trending-item:hover {
    background: #f1f5f9;
}

.trending-rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
    color: #ffffff;
    flex-shrink: 0;
}

.trending-rank.r1 { background: linear-gradient(135deg, #ef4444, #f43f5e); }
.trending-rank.r2 { background: linear-gradient(135deg, #10b981, #059669); }
.trending-rank.r3 { background: linear-gradient(135deg, #3b82f6, #2563eb); }

.trending-favicon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
}

.trending-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #0f172a;
}

.trending-tag {
    margin-left: auto;
    font-size: 0.7rem;
    background: #e2e8f0;
    color: #475569;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
}

.trending-badge {
    font-size: 0.7rem;
    background: #eff6ff;
    color: #2563eb;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

/* Slot 8: Quick Bookmark Launcher */
.launcher-body {
    padding: 10px;
}

.launcher-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.launcher-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    color: #334155;
    font-size: 0.74rem;
    font-weight: 700;
    transition: var(--transition);
}

.launcher-btn img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.launcher-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.15);
}

/* Main Content Area */
.main-content {
    max-width: 1560px;
    margin: 24px auto;
    padding: 0 20px;
}

/* Super-Category Filter Pills Bar */
.category-pills-bar {
    margin-bottom: 24px;
}

.category-pills {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Default Pill Style */
.pill {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 9px 20px;
    border-radius: var(--radius-pill);
    font-size: 0.93rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pill:hover {
    background: linear-gradient(135deg, #ef4444, #f43f5e);
    color: #ffffff;
    border-color: transparent;
    box-shadow: var(--shadow-active);
    transform: translateY(-1px);
}

/* Active Pill Style - Unified Vibrant Coral Red matching '+ 링크 등록' button */
.pill.active {
    background: linear-gradient(135deg, #ef4444, #f43f5e) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: var(--shadow-active) !important;
    font-weight: 800;
    transform: scale(1.02);
}

/* Top 10 Grid (4 Columns Per Row) */
.top10-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

@media (max-width: 1360px) {
    .top10-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 960px) {
    .top10-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 580px) {
    .top10-grid {
        grid-template-columns: 1fr;
    }
}

/* Top 10 Category Card */
.top10-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.top10-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

/* Card Header Banner (Filled with Coral Red button color + White Text) */
.top10-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, #ef4444, #f43f5e);
    border-bottom: 1px solid #e11d48;
    border-top-left-radius: 13px;
    border-top-right-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.top10-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* Top 10 List Body */
.top10-list {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    transition: var(--transition);
}

.rank-item:hover {
    background-color: var(--bg-hover);
    transform: translateX(4px);
}

/* Favicon Icon Styling */
.rank-favicon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
    background: #f8fafc;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Rank Badge Styles */
.rank-badge {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.rank-num-circle {
    width: 21px;
    height: 21px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

/* Item Name Styling */
.rank-name {
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -0.2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Stat Badge on the Right of Item */
.rank-stat-badge {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
    letter-spacing: -0.2px;
    transition: var(--transition);
}

.rank-item:hover .rank-stat-badge {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
}

/* Distinctive Color Mapping Per Rank */
.rank-1 .rank-name { color: var(--rank-1-color); }
.rank-2 .rank-name { color: var(--rank-2-color); }
.rank-3 .rank-name { color: var(--rank-3-color); }
.rank-4 .rank-name { color: var(--rank-4-color); }
.rank-5 .rank-name { color: var(--rank-5-color); }
.rank-6 .rank-name { color: var(--rank-6-color); }
.rank-7 .rank-name { color: var(--rank-7-color); }
.rank-8 .rank-name { color: var(--rank-8-color); }
.rank-9 .rank-name { color: var(--rank-9-color); }
.rank-10 .rank-name { color: var(--rank-10-color); }

/* Footer */
.app-footer {
    border-top: 1px solid var(--border-card);
    background: #ffffff;
    padding: 24px;
    margin-top: 40px;
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
}

/* Modal Overlay & Form */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

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

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-card);
    width: 90%;
    max-width: 440px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}

.close-modal-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.modal-tab {
    background: none;
    border: none;
    font-size: 0.88rem;
    font-weight: 700;
    color: #64748b;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
}

.modal-tab.active {
    background: #eff6ff;
    color: #2563eb;
}

.modal-form-section {
    display: none;
}

.modal-form-section.active {
    display: block;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
}

.form-group input, .form-group select {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #0f172a;
    outline: none;
}

.form-group input:focus, .form-group select:focus {
    border-color: #ef4444;
    background: #ffffff;
}

.form-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-subtle {
    background: #f1f5f9;
    border: none;
    color: #475569;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}


/* Category Card Admin Drag & Drop Styles */
.top10-card.draggable-admin {
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.top10-card.draggable-admin .top10-header {
    cursor: grab;
    user-select: none;
}
.top10-card.dragging {
    opacity: 0.4;
    transform: scale(0.97);
    border: 2px dashed #f43f5e !important;
}
.top10-card.drag-over {
    border: 2px solid #f43f5e !important;
    box-shadow: 0 10px 30px rgba(244, 63, 94, 0.25) !important;
    transform: translateY(-4px);
}


/* Category Edit Modal & Header Color Styles */
.btn-cat-gear {
    background: rgba(255, 255, 255, 0.22);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.2s ease;
    margin-left: auto;
    flex-shrink: 0;
}
.btn-cat-gear:hover {
    background: rgba(255, 255, 255, 0.45);
    transform: rotate(45deg);
}
.color-palette-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.color-pill-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.color-pill-btn:hover {
    transform: scale(1.12);
}
.color-pill-btn.active {
    border-color: #10b981;
    transform: scale(1.18);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.4);
}


/* Market Row Drag and Drop Styles */
.market-item.draggable-admin {
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.market-item.dragging {
    opacity: 0.4;
    background: #f8fafc !important;
    border: 1.5px dashed #f43f5e !important;
}
.market-item.drag-over {
    background: #fff1f2 !important;
    border: 1.5px solid #f43f5e !important;
    transform: translateX(4px);
}


/* Hero Widget Header Only Drag Style */
.hero-widget-header.draggable-header-admin {
    cursor: grab;
    user-select: none;
}
.hero-widget-header.draggable-header-admin:active {
    cursor: grabbing;
}


/* Admin Item Arrow Reorder Buttons */
.admin-item-reorder-btns {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-right: 6px;
    flex-shrink: 0;
}
.btn-item-arrow {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-item-arrow:hover:not(.disabled) {
    background: #f43f5e;
    color: #ffffff;
    border-color: #e11d48;
    transform: scale(1.1);
}
.btn-item-arrow.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}


.btn-item-edit:hover {
    background: #3b82f6 !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
    transform: scale(1.1);
}


/* Contextual Header Admin Action Buttons (+ & ⚙️) */
.header-admin-action-btns {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}
.btn-header-action {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.btn-header-action:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.12);
}
.btn-header-plus:hover {
    background: #10b981 !important;
    color: #ffffff !important;
}


/* Completely hide merged modal tab navigation bar for pure dedicated single popups */
.modal-tab-nav {
    display: none !important;
}


/* Category Link Row Edit Pencil Button */
.btn-rank-edit {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 4px;
}
.btn-rank-edit:hover {
    color: #2563eb;
    background: #eff6ff;
    transform: scale(1.1);
}


/* ==========================================
   Dedicated Top Admin Bar (Admin Logged In Only)
   ========================================== */
.admin-top-bar {
    background: #0f172a;
    color: #f8fafc;
    padding: 6px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid #1e293b;
    position: relative;
    z-index: 1001;
}
.admin-top-container {
    max-width: 1520px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-crown-tag {
    color: #fbbf24;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.3px;
}
.admin-top-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-nav-link {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.admin-nav-link:hover {
    color: #ffffff;
    background: #1e293b;
}
.btn-admin-add-cat {
    background: #ef4444;
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(239,68,68,0.4);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-admin-add-cat:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239,68,68,0.5);
}


/* Secret Footer Copyright Admin Login Link */
.secret-admin-login-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
    transition: opacity 0.2s ease, color 0.2s ease;
}
.secret-admin-login-link:hover {
    color: #ef4444;
    opacity: 0.8;
}


/* ==========================================
   Modern Premium Board Category Pill Tabs
   ========================================== */
#bo_cate {
    margin-bottom: 24px !important;
    background: transparent !important;
}

#bo_cate hr {
    display: none !important;
}

#bo_cate_ul {
    border: none !important;
    gap: 8px !important;
    padding: 6px 0 !important;
}

#bo_cate_ul li {
    border: none !important;
    background: transparent !important;
    margin-right: 2px !important;
}

#bo_cate_ul li a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 9px 20px !important;
    border-radius: 30px !important;
    background: #f1f5f9 !important;
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: 0.92rem !important;
    text-decoration: none !important;
    border: 1px solid #e2e8f0 !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}

#bo_cate_ul li a:hover {
    background: #ffffff !important;
    color: #ef4444 !important;
    border-color: #fca5a5 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(239,68,68,0.15) !important;
}

#bo_cate_ul li.active a,
#bo_cate_ul li.active a:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
    border-color: #ef4444 !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4) !important;
    transform: translateY(-1px) !important;
}

#bo_cate .sly-btn {
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    margin-left: 6px !important;
    transition: all 0.2s ease !important;
}

#bo_cate .sly-btn:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #ef4444 !important;
}


/* ==========================================
   Responsive Taller Video Player in Board View (Perfect for Idol Vertical 직캠 / Shorts)
   ========================================== */
#bo_v_con iframe,
.na-video-link iframe,
.na-video-attach iframe,
#bo_v_con .video-container iframe {
    width: 100% !important;
    height: 680px !important;
    min-height: 600px !important;
    max-height: 82vh !important;
    border-radius: 14px !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18) !important;
}

#bo_v_con .na-video-link,
#bo_v_con .na-video-attach {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 24px !important;
}


/* Board Write Submit Button - Match Cancel Button's Subtle Rectangular Corner */
#btn_submit,
.btn-primary.btn-lg,
button#btn_submit.btn-primary {
    border-radius: 4px !important;
}


/* ==========================================
   Standard Nariya Builder Modal Footer Buttons
   ========================================== */
.modal-footer .btn,
.modal-actions .btn,
.modal-form .btn,
.modal-body .btn {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}


/* Soft Red Delete Button Styling */
#deleteQuickLauncherBtn,
#deleteCommodityBtn,
#deleteStockBtn,
#deleteLinkBtn,
#deleteCategoryCardBtn {
    margin-right: auto !important;
    background-color: #fee2e2 !important;
    color: #dc2626 !important;
    border: none !important;
    padding: 7px 16px !important;
    border-radius: 6px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

#deleteCommodityBtn:hover,
#deleteStockBtn:hover,
#deleteLinkBtn:hover,
#deleteCategoryCardBtn:hover {
    background-color: #fca5a5 !important;
    color: #b91c1c !important;
}


/* Quick Launcher Admin Hover Overlay */
.launcher-btn {
    position: relative !important;
    overflow: hidden !important;
}

.launcher-admin-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 9px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.launcher-btn:hover .launcher-admin-overlay {
    opacity: 1;
}

.btn-launcher-action {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    border: none;
    background: #ffffff;
    color: #334155;
    font-size: 0.68rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: all 0.15s ease;
}

.btn-launcher-action:hover:not(.disabled) {
    transform: scale(1.15);
}

.btn-launcher-action.btn-launcher-edit {
    background: #2563eb;
    color: #ffffff;
}

.btn-launcher-action.btn-launcher-del {
    background: #ef4444;
    color: #ffffff;
}

.btn-launcher-action.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.trending-rank.r4 { background: #64748b; color: #ffffff; }
.trending-rank.r5 { background: #94a3b8; color: #ffffff; }

.trending-rank.r4, .trending-rank.r5, .trending-rank.r6, .trending-rank.r7, .trending-rank.r8, .trending-rank.r9, .trending-rank.r10 {
    background: #64748b;
    color: #ffffff;
}

.logo-icon img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    vertical-align: middle;
    filter: none !important; box-shadow: none !important;
}


/* Google AdSense Custom Search Styles */
.btn-google-search {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    color: #ffffff;
    border: none;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
    flex-shrink: 0;
    margin-left: 6px;
}

.btn-google-search:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.45);
}

.gsc-control-cse {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}



/* Search Box with Right-docked Google Search Button */
.search-box {
    position: relative;
    width: 100%;
    max-width: 440px;
}

.search-box input {
    width: 100%;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 8px 110px 8px 36px;
    border-radius: 20px;
    font-size: 0.88rem;
    color: var(--text-dark);
    outline: none;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box input:focus {
    background: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
    z-index: 2;
}

.clear-btn {
    position: absolute;
    right: 110px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    z-index: 2;
}

.btn-google-search {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    color: #ffffff;
    border: none;
    padding: 5px 12px;
    height: 30px;
    border-radius: 15px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 5px rgba(66, 133, 244, 0.3);
    z-index: 3;
    white-space: nowrap;
    margin: 0 !important;
}

.btn-google-search:hover {
    transform: translateY(-50%) scale(1.03);
    box-shadow: 0 3px 8px rgba(66, 133, 244, 0.45);
}



.admin-nav-link .text-info,
.admin-nav-link i.fa-users {
    color: #06b6d4 !important;
}

.admin-nav-link .text-warning,
.admin-nav-link strong {
    color: #fbbf24 !important;
    font-weight: 800 !important;
}






/* Logo Text Bold (Main & Subpage match) */
.logo-text {
    font-weight: 800 !important;
    font-size: 1.25rem;
    letter-spacing: -0.3px;
}

/* Nariya Admin Side Controller - ONLY VISIBLE TO SUPER ADMIN */
#theme-controller {
    display: none !important;
}
body.is-super-admin #theme-controller,
body.is-admin #theme-controller {
    display: block !important;
}
#theme-controller .fixed-top {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 9999 !important;
    width: 40px !important;
    right: auto !important;
    margin-top: 42px;
}
#theme-controller .btn-group-vertical {
    display: flex !important;
    flex-direction: column !important;
}
#theme-controller .btn.btn-primary {
    display: block !important;
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: #fff !important;
    padding: 8px 0 !important;
    width: 40px !important;
    text-align: center !important;
    border: none !important;
    cursor: pointer !important;
    text-decoration: none !important;
}
#theme-controller .btn.btn-primary:first-child {
    border-radius: 0 6px 0 0 !important;
}
#theme-controller .btn.btn-primary:last-child {
    border-radius: 0 0 6px 0 !important;
}
#theme-controller .btn.btn-primary i {
    font-size: 1rem !important;
}
#theme-controller .sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
}


/* Theme Menu Modal - Link color match subpage (dark, not Bootstrap blue) */
#theme_menu .list-group-item a {
    color: #212529 !important;
    text-decoration: none !important;
}
#theme_menu .list-group-item a:hover {
    color: #007bff !important;
    text-decoration: none !important;
}


/* Fast System Font Stack (replaces slow Google Fonts) */
body, html {
    font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Nanum Gothic', sans-serif !important;
}


/* Subpage Header & Global Fast Local System Font Override */
body, html, h1, h2, h3, h4, h5, h6, .en, .admin-crown-tag, .btn-subtle-auth, .btn-admin-add-cat {
    font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Nanum Gothic', sans-serif !important;
}


/* Unified Fast System Font Stack for Header & Subpages */
body, html, h1, h2, h3, h4, h5, h6, .en, .logo-text, .logo-text span, .admin-crown-tag, .btn-subtle-auth, .btn-subtle-nav, .btn-admin-add-cat, a, input, button, select, textarea {
    font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Nanum Gothic', sans-serif !important;
}


/* Standardize Global HTML Base Font Size to 16px for Exact rem Matching */
html {
    font-size: 16px !important;
}


/* Subpage 3:1 Exact Grid Layout Matching Main Page 4-Column Ratio */
.nt-container .col-md-9 {
    flex: 0 0 75% !important;
    max-width: 75% !important;
}

.nt-container .col-md-3 {
    flex: 0 0 25% !important;
    max-width: 25% !important;
}

.subpage-sidebar-container .hero-widget-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

#bo_list_wrap, #bo_v, #bo_w {
    width: 100% !important;
    max-width: 100% !important;
}


/* Force Subpage .nt-container Max Width to 1560px !important (100% Match Main Page) */
.nt-container, #nt_body .nt-container {
    max-width: 1560px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}


/* Explicit Local System Font Stack for Subpage Sidebar Titles and Cards (Excluding <i> icon tags) */
.subpage-sidebar-container,
.subpage-sidebar-container span:not(.fa-solid):not(.fa-brands):not(.fa),
.hero-widget-header span:not(.fa-solid):not(.fa-brands):not(.fa),
.hero-widget-card span:not(.fa-solid):not(.fa-brands):not(.fa),
.widget-more-link,
.trending-title,
.trending-tag,
.pick-title,
.pick-desc,
.launcher-btn span {
    font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Nanum Gothic', sans-serif !important;
}

/* Re-enforce Font Awesome icon font family for <i> and .fa tags */
i, i.fa-solid, i.fa-brands, i.fa, .fa-solid, .fa-brands, .fa {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
}


/* Board List Post Title Color Fix (Keep Original Dark Text, Not Blue) */
#bo_list a, #bo_list .na-item a, #bo_list td a {
    color: #333333 !important;
    text-decoration: none !important;
}
#bo_list a:hover, #bo_list .na-item a:hover, #bo_list td a:hover {
    color: #0056b3 !important;
    text-decoration: underline !important;
}


/* Admin & Global Select Box Dropdown Text Clipping Fix */
select, form-control, .form-control, .custom-select, table select {
    height: auto !important;
    min-height: 38px !important;
    line-height: 1.45 !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    box-sizing: border-box !important;
}

/* ==========================================
   Pure 16:9 Full Width Video Player (No Letterbox Margin)
   ========================================== */
#bo_v_con .na-video-link,
#bo_v_con .na-video-attach,
#bo_v_con .na-videowrap {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 20px 0 !important;
}

#bo_v_con .na-videoframe {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 56.25% !important; /* Pure 16:9 Intrinsic Ratio */
    overflow: hidden !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.14) !important;
    background: #000000 !important;
}

#bo_v_con .na-videoframe iframe,
#bo_v_con .na-video-link iframe,
#bo_v_con .na-video-attach iframe,
#bo_v_con iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    border-radius: 12px !important;
}
