/* codejaka builder - custom styles */

body {
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 상단 헤더: Unify navbar-sticky-top 는 fixed 에 가깝게 동작해 본문이 가려질 수 있어 일반 흐름으로 둠 */
header.app-site-header {
    position: relative;
    z-index: 1030;
    flex-shrink: 0;
}

main#content {
    flex: 1;
    min-width: 0;
    min-height: 0;
}

/*
 * 페이지 본문·헤더: container-fluid + px-3 px-md-4 px-lg-5
 * 가로는 뷰포트에 맞추되, 좌우에만 여백을 준다 (max-width로 중앙 박스를 쓰지 않음).
 */

/* 빌더: flex + min-height:0 이 메인을 뷰포트에 맞춰 눌러 긴 미리보기가 잘리는 경우 방지 */
body.is-builder main#content {
    flex: 1 0 auto;
    min-height: auto;
}

/* 빌더 상단 툴바: 제목·유형·액션 한 블록으로 정리 */
.builder-toolbar-card {
    background: #fff;
}
.builder-toolbar-card .builder-toolbar-actions {
    border-top: 1px solid rgba(33, 37, 41, 0.08);
    padding-top: 0.75rem;
    margin-top: 0.25rem;
    justify-content: flex-end;
}
@media (min-width: 1200px) {
    .builder-toolbar-card .builder-toolbar-actions {
        border-top: 0;
        padding-top: 0;
        margin-top: 0;
        margin-left: 0.5rem;
        padding-left: 1rem;
        border-left: 1px solid rgba(33, 37, 41, 0.1);
        align-self: stretch;
        align-items: center;
    }
}

.btn.btn-xs {
    padding: 0.2rem 0.5rem !important;
    font-size: 0.75rem !important;
    line-height: 1.5;
    border-radius: 0.25rem;
}

/* 위젯 설정: 편집 가능 변수 행 삭제 버튼 */
.btn-var-remove {
    width: 2.125rem;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(220, 53, 69, 0.35);
    border-radius: 0.375rem;
    background-color: rgba(220, 53, 69, 0.06);
    color: #dc3545;
    flex-shrink: 0;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-var-remove:hover {
    background-color: rgba(220, 53, 69, 0.14);
    border-color: rgba(220, 53, 69, 0.55);
    color: #b02a37;
}
.btn-var-remove:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.2);
}
.btn-var-remove .bi-trash {
    font-size: 1rem;
    line-height: 1;
}

/* 위젯 관리: 상세 페이지 렌더 미리보기 */
.admin-widget-thumb-wrap {
    max-height: 280px;
    overflow: auto;
}
.admin-widget-thumb-img {
    max-height: 260px;
    width: auto;
    object-fit: contain;
}
.admin-widget-preview-surface {
    max-height: 420px;
    overflow: auto;
    border: 1px solid rgba(33, 37, 41, 0.12);
    border-radius: 0.375rem;
    background: #fff;
    padding: 0.75rem;
}
.admin-widget-preview-surface.admin-widget-preview-loading {
    min-height: 120px;
}

.admin-widget-preview-img {
    display: block;
    max-width: 100%;
    height: auto;
}

.admin-widget-list-thumb {
    max-height: 52px;
    max-width: 112px;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
}

.admin-widget-list-thumb-link:hover .admin-widget-list-thumb {
    box-shadow: 0 0 0 2px rgba(55, 125, 255, 0.35);
}

.content-space-1 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.card-transition {
    transition: transform 0.15s, box-shadow 0.15s;
}
.card-transition:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.avatar-sm {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.avatar-soft-primary {
    background-color: rgba(55,125,255,.1);
    color: #377dff;
}
.avatar-circle { border-radius: 50%; }

.bg-soft-primary { background-color: rgba(55,125,255,.1) !important; }
.bg-soft-dark { background-color: rgba(33,37,41,.1) !important; }
.text-primary { color: #377dff !important; }

.font-monospace {
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
}

.alert-soft-info {
    background-color: rgba(0,201,167,.1);
    border: none;
    color: #1e2022;
}

.gu-mirror {
    position: fixed !important;
    margin: 0 !important;
    z-index: 9999 !important;
    opacity: 0.8;
    padding: 8px 12px;
    border: 1px solid #377dff;
    border-radius: 6px;
    background: #eef4ff;
    font-size: 0.85rem;
}
.gu-hide { display: none !important; }
.gu-unselectable { user-select: none !important; }
.gu-transit { opacity: 0.3; }

.btn-ghost-secondary {
    color: #71869d;
    border: none;
    background: transparent;
}
.btn-ghost-secondary:hover {
    color: #1e2022;
    background: rgba(0,0,0,.04);
}

/* 포트폴리오 목록 */
.portfolio-list-toolbar {
    gap: 1rem 1.25rem;
    flex-wrap: wrap;
    align-items: flex-end;
}
.portfolio-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.75rem;
    width: 100%;
}
@media (min-width: 992px) {
    .portfolio-toolbar-actions {
        width: auto;
        max-width: 100%;
        justify-content: flex-end;
    }
}
.portfolio-search-group {
    flex: 1 1 14rem;
    max-width: 100%;
    min-width: 0;
}
@media (min-width: 992px) {
    .portfolio-search-group {
        max-width: 28rem;
    }
}
.portfolio-search-group .portfolio-search-input-inner {
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #d8e0e8;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow:
        0 1px 2px rgba(30, 32, 34, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.portfolio-search-group:hover .portfolio-search-input-inner {
    border-color: #c5ced8;
    background: #fff;
}
.portfolio-search-group .portfolio-search-input-inner .input-group-text {
    border: 0;
    background: transparent;
    padding: 0.55rem 0.25rem 0.55rem 1.1rem;
    color: #8c98a4;
}
.portfolio-search-group .portfolio-search-icon {
    font-size: 1.05rem;
    opacity: 0.9;
}
.portfolio-search-group .portfolio-search-input-inner .form-control.portfolio-search-field,
.portfolio-search-group .portfolio-search-input-inner .form-control {
    border: 0;
    box-shadow: none !important;
    padding: 0.6rem 1.15rem 0.6rem 0.35rem;
    min-height: 2.85rem;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: #1e2022;
    background: transparent;
}
.portfolio-search-group .portfolio-search-input-inner .form-control::placeholder {
    color: #97a4af;
    opacity: 1;
}
.portfolio-search-group .portfolio-search-input-inner .form-control:focus {
    box-shadow: none !important;
}
.portfolio-search-group:focus-within .portfolio-search-input-inner {
    border-color: #377dff;
    background: #fff;
    box-shadow:
        0 0 0 3px rgba(55, 125, 255, 0.18),
        0 2px 8px rgba(30, 32, 34, 0.06);
}
.portfolio-search-group:focus-within .portfolio-search-icon {
    color: #377dff;
}

.portfolio-table thead th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #677788;
    border-bottom-width: 1px;
}
.portfolio-table tbody td {
    vertical-align: middle;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}
.portfolio-table .badge {
    font-size: 0.7rem;
    font-weight: 500;
}
.portfolio-list-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}
@media (max-width: 575.98px) {
    .portfolio-table .btn-group .btn {
        font-size: 0.72rem;
        padding: 0.25rem 0.4rem;
    }
}

/* 내보내기 카드 */
.export-card {
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}
.export-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}
.bg-soft-secondary { background-color: rgba(113,134,157,.1) !important; }

/* 내보내기: 메뉴 깊이 + 썸네일 버튼 (input-group으로 높이 일치, 셀렉트 최소 너비 보장) */
.export-settings-thumbnail-group .export-menu-maxdepth {
    flex: 1 1 auto;
    min-width: 8.75rem;
    width: auto;
}
.export-settings-thumbnail-group .btn {
    white-space: nowrap;
}
