﻿/* Set padding to keep content from hitting the edges */
.body-content {
    margin-top: 150px;
    padding-left: 15px;
    padding-right: 15px;
    border: 1px solid red;
}

/* Override the default bootstrap behavior where horizontal description lists 
   will truncate terms that are too long to fit in the left column 
*/
.dl-horizontal dt {
    white-space: normal;
}

/* Set width on the form input elements since they're 100% wide by default */
input,
select,
textarea {
    max-width: 280px;
}
.chart-content.open {
    max-height: 520px;
}

.chart-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #c1bdbd;
}
* {
    box-sizing: border-box;
}

.select {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 12px 12px 0;
    min-width: 220px; /* 필요시 조절 */
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
}

.select__label {
    font-size: 12px;
    color: #6b7280; /* gray-500 */
}

/* 핵심: 네이티브 select 스타일링 */
.select__field {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    border: 1px solid #d1d5db; /* gray-300 */
    background-color: #fff;
    color: #111827; /* gray-900 */
    border-radius: 10px;
    padding: 10px 40px 10px 12px; /* 오른쪽 여백 = 화살표 공간 */
    font-size: 14px;
    line-height: 1.4;
    outline: none;
    transition: border-color .18s, box-shadow .18s, background-color .18s;
    /* 커스텀 화살표 (오른쪽 12px 위치) */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px 14px;
}

    .select__field:hover {
        border-color: #9ca3af; /* gray-400 */
    }

    .select__field:focus-visible {
        border-color: #3b82f6; /* blue-500 */
        box-shadow: 0 0 0 3px rgba(59,130,246,.2);
    }

    .select__field:disabled {
        background-color: #f3f4f6; /* gray-100 */
        color: #9ca3af;
        cursor: not-allowed;
    }

/* 사이즈 변형 */
.select--sm .select__field {
    padding: 6px 36px 6px 10px;
    font-size: 13px;
    border-radius: 8px;
}

.select--lg .select__field {
    padding: 12px 44px 12px 14px;
    font-size: 15px;
    border-radius: 12px;
}

/* 다크 모드 대응 */
@media (prefers-color-scheme: dark) {
    .select__label {
        color: #9ca3af;
    }

    .select__field {
        background-color: #111827; /* gray-900 */
        color: #e5e7eb; /* gray-200 */
        border-color: #374151; /* gray-700 */
        background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    }

        .select__field:hover {
            border-color: #4b5563;
        }

        .select__field:focus-visible {
            box-shadow: 0 0 0 3px rgba(59,130,246,.35);
        }

        .select__field:disabled {
            background-color: #0b1220;
            color: #6b7280;
        }
}

/* 고대비/접근성 보완 (키보드 포커스 강조) */
.select__field:focus:not(:focus-visible) {
    box-shadow: none;
}

:root {
    --btn-bg: #fff;
    --btn-fg: #111827; /* gray-900 */
    --btn-bd: #d1d5db; /* gray-300 */
    --btn-bg-hover: #f9fafb; /* gray-50 */
    --btn-focus: #3b82f6; /* blue-500 */

    --primary-bg: #3b82f6;
    --primary-fg: #fff;
    --primary-bg-hover: #2563eb; /* blue-600 */

    --danger-bg: #ef4444;
    --danger-fg: #fff;
    --danger-bg-hover: #dc2626; /* red-600 */
}

@media (prefers-color-scheme: dark) {
    :root {
        --btn-bg: #111827; /* gray-900 */
        --btn-fg: #e5e7eb; /* gray-200 */
        --btn-bd: #374151; /* gray-700 */
        --btn-bg-hover: #0b1220;
        --primary-bg: #3b82f6;
        --primary-fg: #fff;
        --primary-bg-hover: #2563eb;
        --danger-bg: #ef4444;
        --danger-fg: #fff;
        --danger-bg-hover: #dc2626;
    }
}

/* 기본 버튼 */
.btn {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--btn-bd);
    background: var(--btn-bg);
    color: var(--btn-fg);
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background-color .18s, border-color .18s, box-shadow .18s, transform .02s;
}

    .btn:hover {
        background: var(--btn-bg-hover);
    }

    .btn:active {
        transform: translateY(1px);
    }

    .btn:focus-visible {
        outline: none;
        border-color: var(--btn-focus);
        box-shadow: 0 0 0 3px rgba(59,130,246,.25);
    }

    .btn:disabled {
        opacity: .55;
        cursor: not-allowed;
        transform: none;
    }

/* 변형 */
.btn--primary {
    background: #111827;
    color: var(--primary-fg);
    border-color: transparent;
}

    .btn--primary:hover {
        background: #111827;
        color: white !important;
    }

.btn--danger {
    background: var(--danger-bg);
    color: var(--danger-fg);
    border-color: transparent;
}

    .btn--danger:hover {
        background: var(--danger-bg-hover);
    }

/* Ghost(윤곽선) */
.btn--ghost {
    background: transparent;
    color: var(--btn-fg);
    border-color: var(--btn-bd);
}

    .btn--ghost:hover {
        background: var(--btn-bg-hover);
    }

/* 사이즈 */
.btn--sm {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 8px;
}

.btn--lg {
    padding: 12px 16px;
    font-size: 15px;
    border-radius: 12px;
}

.btn--block {
    display: flex;
    width: 100%;
}

/* 아이콘 간격 */
.btn__icon {
    flex: 0 0 auto;
}

/* 로딩 스피너 */
.spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    display: inline-block;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}