/* GY-ENGINE Utility Classes v1.0 — 모든 컴포넌트 공용 */
/* 이 파일은 header.php에서 전역 로드됨 — 컴포넌트 내 중복 정의 금지 */

/* ── Display ─────────────────────────────────────────── */
.flex          { display: flex; }
.inline-flex   { display: inline-flex; }
.block         { display: block; }
.hidden        { display: none; }
.grid          { display: grid; }

/* ── Flex Direction ──────────────────────────────────── */
.flex-col      { flex-direction: column; }
.flex-row      { flex-direction: row; }
.flex-wrap     { flex-wrap: wrap; }

/* ── Flex Alignment ──────────────────────────────────── */
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.items-end       { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.flex-between    { display: flex; justify-content: space-between; align-items: center; }
.flex-1          { flex: 1; }
.flex-shrink-0   { flex-shrink: 0; }
.ml-auto         { margin-left: auto; }

/* ── Gap ─────────────────────────────────────────────── */
.gap-4  { gap: 4px; }
.gap-5  { gap: 5px; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }

/* ── Grid ────────────────────────────────────────────── */
.grid-cols-2 { grid-template-columns: 1fr 1fr; }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ── Padding ─────────────────────────────────────────── */
.p-0   { padding: 0 !important; }
.p-5   { padding: 5px; }
.p-8   { padding: 8px; }
.p-10  { padding: 10px; }
.p-15  { padding: 15px; }
.p-20  { padding: 20px; }
.px-10 { padding-left: 10px; padding-right: 10px; }
.px-15 { padding-left: 15px; padding-right: 15px; }
.px-20 { padding-left: 20px; padding-right: 20px; }
.py-5  { padding-top: 5px; padding-bottom: 5px; }
.py-10 { padding-top: 10px; padding-bottom: 10px; }
.pt-5  { padding-top: 5px; }
.pt-10 { padding-top: 10px; }
.pb-10 { padding-bottom: 10px; }

/* ── Margin ──────────────────────────────────────────── */
.m-0   { margin: 0; }
.mt-5  { margin-top: 5px; }
.mt-10 { margin-top: 10px; }
.mb-0  { margin-bottom: 0; }
.mb-5  { margin-bottom: 5px; }
.mb-8  { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }

/* ── Typography ──────────────────────────────────────── */
.text-xs    { font-size: 11px; }
.text-sm    { font-size: 13px; }
.text-base  { font-size: 14px; }
.font-bold  { font-weight: 700; }
.font-800   { font-weight: 800; }
.uppercase  { text-transform: uppercase; }
.text-gray  { color: #64748b; }
.text-light { color: #f8fafc; }
.text-blue  { color: #3b82f6; }
.text-pink  { color: #db2777; }
.text-green { color: #16a34a; }
.text-center { text-align: center; }
.text-left  { text-align: left; }
.code-font  { font-family: 'JetBrains Mono', 'Fira Code', monospace; }

/* ── Border ──────────────────────────────────────────── */
.border       { border: 1px solid #e2e8f0; }
.border-b     { border-bottom: 1px solid #e2e8f0; }
.border-t     { border-top: 1px solid #e2e8f0; }
.border-r     { border-right: 1px solid #e2e8f0; }
.border-l     { border-left: 1px solid #e2e8f0; }
.rounded      { border-radius: 8px; }
.rounded-lg   { border-radius: 12px; }
.rounded-full { border-radius: 9999px; }

/* ── Background ──────────────────────────────────────── */
.bg-white  { background: #fff; }
.bg-light  { background: #f8fafc; }
.bg-dark   { background: #1e293b; }
.bg-dark-header { background: #0f172a; }
.bg-black  { background: #000; }

/* ── Overflow / Size ─────────────────────────────────── */
.overflow-hidden  { overflow: hidden; }
.overflow-auto    { overflow: auto; }
.overflow-x-auto  { overflow-x: auto; }
.w-100    { width: 100%; box-sizing: border-box; }
.h-100    { height: 100%; }
.min-w-0  { min-width: 0; }
.relative { position: relative; }
.absolute { position: absolute; }

/* ── Badge ───────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}
.badge.bg-blue  { background: #3b82f6; color: #fff; }
.badge.bg-red   { background: #ef4444; color: #fff; }
.badge.bg-green { background: #22c55e; color: #fff; }

/* ── Buttons ─────────────────────────────────────────── */
.btn-sm {
    padding: 5px 12px;
    border-radius: 6px;
    border: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    background: #e2e8f0;
    color: #334155;
}
.btn-sm:hover { filter: brightness(0.95); }

.btn-tool {
    padding: 7px 14px;
    border-radius: 6px;
    border: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    background: #e2e8f0;
    color: #334155;
}
.btn-tool.blue    { background: #3b82f6; color: #fff; }
.btn-tool.outline { background: transparent; border: 1px solid #cbd5e1; color: #475569; }
.btn-tool:hover   { filter: brightness(0.92); transform: translateY(-1px); }

.btn-chip {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    color: #64748b;
    transition: background 0.15s;
}
.btn-chip:hover  { background: #e2e8f0; }
.btn-chip.pink   { background: #fdf2f8; color: #db2777; border-color: #fbcfe8; }
.btn-chip.blue   { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }

.btn-outline {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-outline:hover   { background: #f1f5f9; }
.btn-text-only       { background: none; border: none; cursor: pointer; }
.btn-icon-sm         { background: none; border: none; cursor: pointer; font-size: 18px; padding: 0 4px; }

/* ── Form Elements ───────────────────────────────────── */
.input-pastel {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #fff;
    transition: border-color 0.2s;
    font-family: inherit;
}
.input-pastel:focus { outline: none; border-color: #3b82f6; }

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #475569;
}

/* ── Card / Panel ────────────────────────────────────── */
.editor-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
}
.editor-toolbar {
    padding: 8px 14px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
}
.editor-toolbar .label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.config-panel {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
}
.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.panel-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

/* ── Section Tags ────────────────────────────────────── */
.section-tag {
    display: block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #94a3b8;
    margin-bottom: 10px;
}

/* ── Prop Section ────────────────────────────────────── */
.prop-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
}

/* ── Animation ───────────────────────────────────────── */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}
.animate-pulse { animation: pulse 2s infinite; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.3s ease; }

/* ── Ace Editor Container ────────────────────────────── */
.ace-editor-container { width: 100%; min-height: 160px; }
.dark-ace { background: #0f172a; }

/* ── Scrollbar ───────────────────────────────────────── */
.scrollbar-none { scrollbar-width: none; }
.scrollbar-none::-webkit-scrollbar { display: none; }

/* ── Tutorial Hint System ────────────────────────────── */
.btn-hint {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #15803d;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-hint:hover { background: #dcfce7; border-color: #86efac; transform: translateY(-1px); }
.btn-hint.is-open { background: #dcfce7; border-color: #86efac; }

.hint-panel {
    background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
    border: 1px solid #bbf7d0;
    border-radius: 16px;
    padding: 16px 20px;
    margin-top: 10px;
    animation: hint-slide-in 0.25s ease;
}
@keyframes hint-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hint-panel[hidden] { display: none; }

.hint-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 800;
    color: #15803d;
    margin-bottom: 10px;
}

.hint-steps {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.hint-steps li {
    font-size: 0.82rem;
    color: #374151;
    line-height: 1.5;
    padding-left: 4px;
}
.hint-steps li strong { color: #1e293b; }
.hint-steps li code {
    background: rgba(255,255,255,0.8);
    border: 1px solid #d1fae5;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.78rem;
    color: #065f46;
    font-family: 'Consolas', monospace;
}

.hint-tip {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.6);
    border-radius: 10px;
    font-size: 0.78rem;
    color: #475569;
    border: 1px solid rgba(255,255,255,0.8);
}
