/* ===================================
   HanjaPass Admin - 미니멀 스타일
   =================================== */

:root {
    --primary: #dc3545;
    --header-color: #2c7a7b;
    --header-color-light: #38a3a5;
    --text: #333;
    --border: #e0e0e0;
    --bg: #fafafa;
    --module-bg: white;
    --hover-bg: #f5f5f5;
}

@media (prefers-color-scheme: dark) {
    :root {
        --text: #e0e0e0;
        --border: #3a3a3a;
        --bg: #1a1a1a;
        --module-bg: #2a2a2a;
        --hover-bg: #333;
    }
}




/* ICONS - 테마아이콘 */
.theme-toggle svg.theme-icon-when-auto,
.theme-toggle svg.theme-icon-when-dark,
.theme-toggle svg.theme-icon-when-light {
    /* fill: var(--header-color); */
    /* color: var(--header-bg); */
    color: #00000000;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* 헤더 */
#header {
    background: linear-gradient(135deg, var(--header-color) 0%, var(--header-color-light) 100%);
    border-bottom: none;
}

#branding h1 a {
    color: white;
}

#user-tools a {
    color: rgba(255, 255, 255, 0.9);
}

#user-tools a:hover {
    color: white;
}
/* Breadcrumbs */
.breadcrumbs {
    background: var(--module-bg);
    border-bottom: 1px solid var(--border);
}

.breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
}

/* 콘텐츠 영역 */
#content {
    background: var(--bg);
}

#content-main {
    background: var(--bg);
}

div.colMS,
div.colM,
div.colSM {
    background: var(--bg);
    text-decoration: none;
}

/* 모듈 */
.module {
    background: var(--module-bg);
    border: 1px solid var(--border);
    border-radius: 2px;
}

.module h2,
.module caption {
    background: linear-gradient(135deg, var(--header-color) 0%, var(--header-color-light) 100%);
    color: white;
    border-bottom: none;
    font-weight: 500;
    padding: 12px 15px;
}

/* 폼 섹션 헤더 */
fieldset.module h2,
.inline-group h2 {
    background: #adb5bd;
    color: white;
    padding: 10px 15px;
    margin: 0 0 15px 0;
    border-radius: 2px;
}
.inline-group h2 {
    margin-bottom: 0px !important;
}

/* 버튼 */
.button,
input[type="submit"],
input[type="button"],
.submit-row input,
a.button {
    background: var(--primary);
    border: none;
    border-radius: 2px;
}

.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: #c82333;
}

/* 링크 */
a {
    color: var(--primary);
}

a:hover {
    color: #c82333;
}

/* 테이블 */
#result_list th {
    background: var(--module-bg);
    font-weight: 500;
    text-transform: none;
    border-bottom: 2px solid var(--border);
    color: var(--text);
}

#result_list tbody tr {
    background: var(--module-bg);
    color: var(--text);
}

/* 폼 */
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="url"],
.form-row input[type="number"],
.form-row select,
.form-row textarea {
    border: 1px solid var(--border);
    border-radius: 2px;
    background: var(--module-bg);
    color: var(--text);
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: var(--primary);
    outline: none;
}

.form-row label {
    color: var(--text);
}form-row textarea {
    border: 1px solid var(--border);
    border-radius: 2px;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: var(--primary);
    outline: none;
}

/* 메시지 */
.messagelist li {
    border-radius: 2px;
    border-left: 3px solid;
}

.messagelist .success {
    background: #f0f9f4;
    color: #155724;
    border-color: #28a745;
}

/* 필터 */
#changelist-filter {
    background: var(--module-bg);
    border: 1px solid var(--border);
}

#changelist-filter h2,
#changelist-filter h3 {
    background: var(--module-bg);
    font-weight: 500;
    color: var(--text);
}

#changelist-filter li a {
    color: var(--text);
}

#changelist-filter li.selected a {
    color: var(--primary);
    font-weight: 500;
}
/* 필터 */
#changelist-filter {
    background: white;
    border: 1px solid var(--border);
}

#changelist-filter h2,
#changelist-filter h3 {
    background: white;
    font-weight: 500;
}

#changelist-filter li.selected a {
    color: var(--primary);
    font-weight: 500;
}

/* 사이드바 네비게이션 - Collapsible */
.app-list {
    margin: 0;
    padding: 0;
}

.app-list .app {
    margin-bottom: 2px;
    background: var(--module-bg);
    /* border: 1px solid var(--border); */
    border-radius: 0;
    overflow: hidden;
    transition: all 0.2s ease;
    /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); */
}

/* .app-list .app:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
} */

.app-list .app-header {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #cecfd0 0%, #e5e5e6 100%);
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.app-list .app-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.1) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.app-list .app-header:hover::before {
    opacity: 1;
}

.app-list .app-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    margin: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    min-width: 28px;
    min-height: 28px;
}

.app-list .app.expanded .app-toggle {
    transform: rotate(180deg);
}

.app-list .app:not(.expanded) .app-toggle {
    transform: rotate(0deg);
}



.app-list .app.expanded .app-toggle:hover {
    transform: rotate(180deg) scale(1.05);
}

.app-list .app:not(.expanded) .app-toggle:hover {
    transform: rotate(0deg) scale(1.05);
}

.app-list .app-toggle .icon-chevron {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-list .section-title {
    flex: 1;
    color: rgb(34, 33, 33);
    /* padding: 12px 15px 12px 4px; */
    font-weight: 600;
    font-size: 13.5px;
    text-decoration: none;
    display: block;
    letter-spacing: 0.3px;
    z-index: 1;
    /* text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); */
}

.app-list .section-title:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.app-list .model-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    border-top: 1px solid var(--border);
    display: none;
    /* animation: slideDown 0.2s ease-out; */
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-list .app.expanded .model-list {
    display: block;
}

.app-list .model-item {
    display: flex;
    align-items: center;
    position: relative;
}

.app-list .model-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    /* background: var(--primary); */
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.app-list .model-item:hover::before,
.app-list .model-item:has([aria-current="page"])::before {
    transform: scaleX(1);
}

.app-list .model-item > a {
    flex: 1;
    display: block;
    padding: 4px 15px 4px 18px;
    color: var(--text);
    text-decoration: none;
    background: var(--module-bg);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    position: relative;
}

.app-list .model-item > a::before {
    content: '›';
    position: absolute;
    left: 8px;
    opacity: 0;
    transition: all 0.2s ease;
    color: var(--primary);
    font-weight: bold;
}

.app-list .model-item > a:hover {
    background: var(--hover-bg);
    padding-left: 22px;
    color: var(--primary);
}

.app-list .model-item > a:hover::before {
    opacity: 1;
    left: 10px;
}

.app-list .model-item > a.current-page,
.app-list .model-item > a[aria-current="page"],
.app-list .model-item.current-model > a {
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.08) 0%, rgba(220, 53, 69, 0.03) 100%);
    color: var(--primary);
    font-weight: 700;
    padding-left: 22px;
    border-left: 4px solid var(--primary);
}

.app-list .model-item > a.current-page::before,
.app-list .model-item > a[aria-current="page"]::before,
.app-list .model-item.current-model > a::before {
    content: '●';
    opacity: 1;
    left: 10px;
    font-size: 10px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}
.app-list .model-item .addlink {
    display: none !important;
}

/* 현재 앱 강조 */
.app-list .app.current-app {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.15);
}

.app-list .app.current-app .app-header {
    background: linear-gradient(135deg, var(--primary) 0%, #e85d6b 100%);
}

.app-list .app.current-app .section-title {
    font-weight: 700;
}

/* 다크모드 개선 */
@media (prefers-color-scheme: dark) {
    .app-list .app {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
    
    .app-list .app:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }
    
    .app-list .app.current-app {
        box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    }
    
    .app-list .section-title {
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
}




