@charset "utf-8";

/* Custom CSS for Printown Design Overhaul */
/* Reference: RuangAdmin Dashboard Style & DataTables */

:root {
    /* printown_style.css 기준값 유지 (충돌 방지) */
    --pt-primary: #2563ea;
    --pt-secondary: #0f172a;   /* 거의 검정 — h1~h6 기본색 */
    --pt-text: #475569;
    --pt-bg: #f8fafc;
    /* Admin/WBS 보조 */
    --pt-gray-100: #f8f9fc;
    --pt-gray-200: #eaecf4;
    --pt-gray-300: #dddfeb;
    --pt-gray-400: #d1d3e2;
    --pt-gray-500: #b7b9cc;
    --pt-gray-600: #858796;
    --pt-gray-700: #6e707e;
    --pt-gray-800: #5a5c69;
    --pt-gray-900: #3a3b45;
}

/* Global Scope for Board Areas */
#bo_list,
#bo_v,
#bo_w {
    /* font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; */
    width: 100% !important;
    box-sizing: border-box;
}

/* Helper Classes */
.mb-4 {
    margin-bottom: 1.5rem !important;
}

.py-3 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.align-items-center {
    align-items: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.d-flex {
    display: flex !important;
}

.gap-2 {
    gap: 0.5rem;
}

/* CARD COMPONENT */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid #e3e6f0;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 0.75rem 1.25rem;
    margin-bottom: 0;
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h6 {
    margin: 0;
    font-weight: 700;
    color: #4e73df;
    font-size: 1rem;
}

.card-body {
    flex: 1 1 auto;
    padding: 1.25rem;
}

/* TABLE FLUSH STYLE */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-flush {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
}

.table-flush td,
.table-flush th {
    border-top: 1px solid #e3e6f0;
    border-right: 0;
    border-left: 0;
    padding: 1rem 0.75rem;
    vertical-align: middle;
}

.table-flush thead th {
    border-bottom: 2px solid #e3e6f0;
    background-color: #f8f9fc;
    color: #4e73df;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    white-space: nowrap;
}

.table-flush tbody tr:first-child td {
    border-top: 0;
}

.table-flush tbody tr:hover {
    background-color: #fafafa;
}

/* PAGINATION STYLES */
.pg_wrap {
    display: flex !important;
    justify-content: center !important;
    margin-top: 20px;
    margin-bottom: 20px;
}

.pg {
    display: flex;
    padding-left: 0;
    list-style: none;
}

.pg_page,
.pg_current {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    margin-left: -1px;
    line-height: 1.25;
    color: #3a8afd;
    background-color: #fff;
    border: 1px solid #dddfeb;
    text-decoration: none !important;
}

.pg_current {
    z-index: 1;
    color: #fff;
    background-color: #3a8afd;
    border-color: #3a8afd;
}

.pg_page:hover {
    color: #224abe;
    background-color: #eaecf4;
    border-color: #dddfeb;
}

.pg_start,
.pg_prev,
.pg_next,
.pg_end {
    display: inline-block;
    width: 36px;
    height: 38px;
    line-height: 38px;
    text-align: center;
    color: transparent;
    /* Hide text */
    position: relative;
    border: 1px solid #dddfeb;
    background: #fff;
    margin-left: -1px;
    overflow: hidden;
}

.pg_start:after {
    content: '\f100';
    color: #858796;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    font-size: 14px;
}

.pg_prev:after {
    content: '\f104';
    color: #858796;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    font-size: 14px;
}

.pg_next:after {
    content: '\f105';
    color: #858796;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    font-size: 14px;
}

.pg_end:after {
    content: '\f101';
    color: #858796;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    font-size: 14px;
}


/* SEARCH BAR FIX */
.bo_sch {
    display: inline-block;
}

.bo_sch .form-control {
    border-radius: 0.35rem 0 0 0.35rem;
}

.bo_sch .btn {
    border-radius: 0 0.35rem 0.35rem 0;
}

/* FORM CONTROLS */
.form-control {
    display: block;
    width: 100%;
    height: calc(1.5em + .75rem + 2px);
    padding: .375rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #6e707e;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #d1d3e2;
    border-radius: .35rem;
}

.btn-icon-split {
    padding: 0;
    overflow: hidden;
    display: inline-flex;
    align-items: stretch;
    justify-content: center;
}

.btn-icon-split .icon {
    background: rgba(0, 0, 0, .15);
    display: inline-block;
    padding: .375rem .75rem;
}

.btn-icon-split .text {
    display: inline-block;
    padding: .375rem .75rem;
}

/* ========================================
   CATEGORY TAB STYLES (Horizontal Pills)
   Reference: etertech portfolio design
   ======================================== */

/* Hide the default category heading */
#bo_cate h2 {
    position: absolute;
    left: -9999px;
    font-size: 0;
}

/* Category navigation container */
#bo_cate {
    margin-bottom: 1.5rem;
    padding: 0;
    background: transparent;
}

/* Category list - horizontal flex layout */
#bo_cate_ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Category list items */
#bo_cate_ul li {
    margin: 0;
    padding: 0;
}

/* Category links - pill style */
#bo_cate_ul li a {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 400;
    color: #6c757d;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 28px;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* Hover effect */
#bo_cate_ul li a:hover {
    color: var(--pt-primary, #3a8afd);
    background-color: #e9ecef;
    border-color: var(--pt-primary, #3a8afd);
}

/* Active category tab */
#bo_cate_ul li a#bo_cate_on {
    color: #e94e1b;
    font-weight: 700;
    background-color: #f5d9cf;
    border-color: #e94e1b;
}

/* ========================================
   BUTTON FIXES (migrated from head.sub.php inline)
   ======================================== */
a.btn,
button.btn,
input.btn,
.btn {
    display: inline-flex !important;
    width: auto !important;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
    border-radius: 0.35rem;
    transition: all 0.2s ease-in-out;
    margin: 0 4px 4px 0;
    text-decoration: none !important;
}

.btn-primary {
    color: #fff !important;
    background-color: #4e73df !important;
    border-color: #4e73df !important;
}

.btn-primary:hover {
    background-color: #2e59d9 !important;
    border-color: #2653d4 !important;
}

.btn-secondary {
    color: #fff !important;
    background-color: #858796 !important;
    border-color: #858796 !important;
}

.btn-danger {
    color: #fff !important;
    background-color: #e74a3b !important;
    border-color: #e74a3b !important;
}

.btn-group {
    position: relative;
    display: inline-flex !important;
    vertical-align: middle;
    width: auto !important;
}

/* ========================================
   TEMPLATE LIST STYLES (migrated from template_list.php inline)
   ======================================== */

/* Card hover effects */
.pt-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pt-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.pt-card:hover .pt-overlay {
    opacity: 1 !important;
    visibility: visible !important;
}

.pt-overlay {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Template page sections */
.pt-section-hero {
    background: #f8fafc;
    padding: 60px 0;
    border-bottom: 1px solid #e2e8f0;
}

.pt-section-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.pt-section-hero p {
    color: #64748b;
    font-size: 1.1rem;
}

.pt-section-body {
    padding-top: 60px;
}

/* Template grid layout */
.pt-layout-flex {
    display: flex;
    gap: 40px;
}

.pt-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.pt-main-content {
    flex: 1;
}

/* Template grid */
.pt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Template card inner */
.pt-thumb {
    height: 200px;
    background: #f1f5f9;
    position: relative;
    overflow: hidden;
}

.pt-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.pt-card-body {
    padding: 20px;
}

.pt-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.pt-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pt-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pt-card-id {
    font-size: 0.9rem;
    color: #64748b;
}

.pt-card-price {
    font-weight: 700;
    color: var(--pt-primary);
}

/* Preview button on overlay */
.pt-btn {
    background: white;
    color: #0f172a;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
}

/* Wish button */
.btn-wish {
    background: rgba(255,255,255,0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}

.btn-wish.active {
    color: #ff4757;
}

/* Search input in sidebar */
.pt-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
}

.pt-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
}

/* Sort bar */
.pt-sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.pt-sort-count {
    color: #64748b;
}

.pt-sort-select {
    border: 1px solid #cbd5e1;
    padding: 8px 12px;
    border-radius: 6px;
    color: #475569;
}

/* L2 Category tabs (pill style) */
.pt-l2-header {
    margin-bottom: 30px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 15px;
}

.pt-l2-title {
    font-size: 1.2rem;
    margin: 0 0 15px;
    font-weight: 700;
}

.pt-l2-subtitle {
    font-weight: 400;
    font-size: 1rem;
    color: #64748b;
}

.pt-l2-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pt-l2-pill {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    text-decoration: none;
}

/* Dev language icon colors */
.pt-icon-php {
    color: #777bb3;
}

.pt-icon-html {
    color: #e34f26;
}

/* Empty state */
.pt-empty {
    text-align: center;
    padding: 100px 0;
    color: #94a3b8;
}

.pt-empty i {
    font-size: 4rem;
    margin-bottom: 20px;
}

.pt-empty p {
    font-size: 1.2rem;
}

/* Pagination wrapper */
.pt-pagination {
    margin-top: 50px;
    text-align: center;
}

/* ========================================
   UTILITY CLASS SYSTEM
   Phase 1 CSS 정규화 — 인라인 style="" 대체용
   2026-05-20
   ======================================== */

/* --- 색상 유틸리티 --- */
.c-slate-400  { color: #94a3b8; }
.c-slate-500  { color: #64748b; }
.c-slate-600  { color: #475569; }
.c-gray-400   { color: #cbd5e1; }
.c-gray-600   { color: #666; }
.c-gray-700   { color: #444; }
.c-white      { color: #fff; }
.c-primary    { color: var(--pt-primary); }
.c-secondary  { color: var(--pt-secondary); }

/* --- 폰트 유틸리티 --- */
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.fs-sm  { font-size: 0.85rem; }
.fs-md  { font-size: 0.95rem; }
.fs-lg  { font-size: 1.1rem; }
.fs-xl  { font-size: 1.25rem; }
.fs-2xl { font-size: 1.5rem; }
.fs-h1  { font-size: 2.5rem; font-weight: 700; }
.fs-h2  { font-size: 2rem; font-weight: 700; }
.fs-icon{ font-size: 20px; }
.fs-icon-lg { font-size: 32px; }
.fs-icon-xl { font-size: 40px; }
.lh-18  { line-height: 1.8; }

/* --- 간격 유틸리티 --- */
.m-0    { margin: 0; }
.mt-16  { margin-top: 16px; }
.mt-30  { margin-top: 30px; }
.mt-60  { margin-top: 60px; }
.mb-8   { margin-bottom: 8px; }
.mb-10  { margin-bottom: 10px; }
.mb-12  { margin-bottom: 12px; }
.mb-20  { margin-bottom: 20px; }
.mb-24  { margin-bottom: 24px; }
.mb-30  { margin-bottom: 30px; }
.mb-40  { margin-bottom: 40px; }
.ml-8   { margin-left: 8px; }
.mr-5   { margin: 0 5px; }

.p-16   { padding: 16px; }
.p-20   { padding: 20px; }
.p-30   { padding: 30px; }
.px-section { padding: 40px 20px; }
.py-section { padding: 60px 0; }
.py-section-lg { padding: 100px 0; }

/* --- 레이아웃 유틸리티 --- */
.pos-relative   { position: relative; }
.pos-absolute   { position: absolute; }
.text-center    { text-align: center; }
.overflow-hidden{ overflow: hidden; }

/* Flex 조합 */
.flex-between   { display: flex; justify-content: space-between; align-items: center; }
.flex-center    { display: flex; justify-content: center; align-items: center; }
.flex-start     { display: flex; align-items: flex-start; }
.flex-col       { display: flex; flex-direction: column; }
.flex-1         { flex: 1; }
.flex-grow      { flex: 1; min-width: 300px; }

/* Grid 조합 */
.grid-auto-300  { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }
.grid-auto-350  { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 30px; }
.grid-3col      { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
@media (max-width: 992px) {
    .grid-3col  { grid-template-columns: repeat(2, 1fr); gap: 24px; }
    .grid-auto-300, .grid-auto-350 { gap: 20px; }
}
@media (max-width: 640px) {
    .grid-3col  { grid-template-columns: 1fr; gap: 20px; }
    .flex-between, .flex-start { flex-wrap: wrap; }
    .flex-grow  { min-width: 100%; }
    .py-section { padding: 40px 0; }
    .py-section-lg { padding: 60px 0; }
    .fs-h1      { font-size: 1.8rem; }
    .fs-h2      { font-size: 1.5rem; }
}

/* --- 카드 컴포넌트 유틸리티 --- */
.ui-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.ui-icon-box {
    width: 80px; height: 80px;
    background: #eff6ff;
    color: var(--pt-primary);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 24px;
}

.ui-timeline-dot {
    position: absolute;
    left: -49px; top: 5px;
    width: 16px; height: 16px;
    background: #ccc;
    border-radius: 50%;
}

/* --- 섹션 패턴 유틸리티 --- */
.section-bg-light { background: #f8f9fa; }
.section-bg-slate { background: #f8fafc; }
.section-dark {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
}
.section-dark p  { color: rgba(255,255,255,0.8); }
.section-border-b { border-bottom: 1px solid #e2e8f0; }

/* --- 탭 유틸리티 --- */
.ui-tab-wrap {
    display: inline-flex;
    align-items: center;
    background: #e2e8f0;
    padding: 4px;
    border-radius: 30px;
}
.ui-tab-btn {
    padding: 10px 24px;
    border-radius: 24px;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
}
.ui-tab-btn.active {
    background: white;
    color: var(--pt-primary);
}
.ui-tab-btn-line {
    padding: 15px 30px;
    cursor: pointer;
    color: #666;
    border: none;
    background: transparent;
}
.ui-tab-btn-line.active {
    font-weight: bold;
    color: var(--pt-primary);
    border-bottom: 3px solid var(--pt-primary);
}

/* ========================================
   PREVIEW PAGE STYLES (.pv-*)
   Phase 1-3: preview.php <style> 블록 추출
   ======================================== */
.pv-body {
    margin: 0; padding: 0; overflow: hidden;
    background: #0f172a; height: 100vh;
    display: flex; flex-direction: column;
}
.pv-toolbar {
    height: 60px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    z-index: 1000;
}
.pv-brand {
    font-size: 1.2rem; font-weight: 800;
    color: white; display: flex;
    align-items: center; gap: 10px;
    text-decoration: none;
}
.pv-brand span { color: var(--pt-primary); }
.pv-brand:hover { color: white; }
.pv-controls {
    display: flex; background: #0f172a;
    padding: 4px; border-radius: 8px;
    border: 1px solid #334155;
}
.pv-device-btn {
    background: transparent; border: none;
    color: #94a3b8; padding: 8px 16px;
    cursor: pointer; border-radius: 6px;
    transition: all 0.2s; font-size: 1.1rem;
}
.pv-device-btn:hover { color: white; }
.pv-device-btn.active { background: #334155; color: white; }
.pv-actions { display: flex; align-items: center; gap: 16px; }
.pv-container {
    flex: 1; background: #cbd5e1;
    position: relative; display: flex;
    justify-content: center; align-items: flex-start;
    overflow-y: auto; padding: 20px;
}
.pv-frame-wrapper {
    background: white; transition: all 0.3s ease;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
}
.pv-frame-wrapper.desktop { width: 100%; height: 100%; }
.pv-frame-wrapper.tablet  { width: 768px; height: 900px; margin-top: 20px; border-radius: 12px; overflow: hidden; }
.pv-frame-wrapper.mobile  { width: 375px; height: 800px; margin-top: 20px; border-radius: 20px; border: 8px solid #1e293b; }
.pv-frame-wrapper iframe  { width: 100%; height: 100%; border: none; display: block; }

/* ========================================
   TAIL.PHP 전용 클래스
   Phase 1-10: tail.php style="" 제거 대체
   ======================================== */
.footer-brand {
    font-size: 24px; font-weight: 800;
    color: white; display: block; margin-bottom: 20px;
    text-decoration: none;
}
.footer-brand:hover { color: white; text-decoration: none; }
.footer-social { margin-top: 20px; display: flex; gap: 15px; }
.footer-social a { text-decoration: none; }
.footer-legal { display: flex; gap: 20px; }
.to-top-btn {
    position: fixed; bottom: 30px; right: 30px;
    width: 50px; height: 50px;
    background: var(--pt-primary); color: white;
    border-radius: 50%; display: flex;
    align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 900; opacity: 0; pointer-events: none;
    transition: all 0.3s;
    text-decoration: none;
}
.pt-sort-wrap { display: flex; gap: 10px; }
/* btn-ghost: 테두리 없는 투명 버튼 */
.btn-ghost { border: none !important; background: transparent; }
.btn-ghost:hover { background: #f1f5f9; }

