/* KFQ 인증기술팀 스타일 - tech.kfq.or.kr 기반 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Malgun Gothic', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 헤더 */
.page-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    color: white;
    padding: 0 30px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.header-logo:hover {
    opacity: 0.9;
}

.header-logo-icon {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #1e3a5f;
    font-size: 14px;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.header-subtitle {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
}

/* 메인 컨텐츠 */
main {
    flex: 1;
    padding: 30px 20px;
    padding-top: 90px; /* Account for fixed header */
}

.container {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    gap: 20px;
}

/* 카드 스타일 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.card-header {
    background-color: #1e3a5f;
    color: white;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header .icon {
    font-size: 18px;
}

.card-body {
    padding: 0;
}

/* 메뉴 아이템 */
.menu-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s;
    cursor: pointer;
}

.menu-item:hover {
    background-color: #e8f4fd;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item.active-tool {
    background-color: #e8f4fd;
    cursor: default;
}

.menu-icon {
    width: 40px;
    height: 40px;
    background-color: #e8f4fd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 15px;
    transition: background-color 0.2s;
}

.menu-item:hover .menu-icon {
    background-color: #d0e8f9;
}

.menu-content {
    flex: 1;
}

.menu-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.menu-desc {
    font-size: 12px;
    color: #888;
}

.arrow {
    font-size: 20px;
    color: #aaa;
    transition: transform 0.2s;
}

.menu-item:hover .arrow {
    transform: translateX(3px);
}

.current-badge {
    background-color: #1e3a5f;
    color: white;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
}

/* 메인 카드 (NC 분류) */
.main-card .card-body {
    padding: 25px;
}

.input-section {
    margin-bottom: 20px;
}

.notice {
    margin-top: 12px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #5a6c7d;
    background-color: #f0f4f8;
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid #2c5282;
    line-height: 1.5;
}

.input-section label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.input-section textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-section textarea:focus {
    outline: none;
    border-color: #2c5282;
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.input-section textarea::placeholder {
    color: #aaa;
}

.input-section button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding: 12px 25px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.input-section button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.3);
}

.input-section button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 16px;
}

/* 결과 섹션 */
.result-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

.result-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1e3a5f;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #f8fafc;
    border-radius: 8px;
    margin-bottom: 10px;
}

.result-item:last-child {
    margin-bottom: 0;
}

.rank {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    margin-right: 15px;
    flex-shrink: 0;
}

.clause {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    min-width: 120px;
}

.probability {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 20px;
}

.prob-bar {
    height: 8px;
    background: linear-gradient(90deg, #1e3a5f 0%, #2c5282 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.prob-text {
    font-size: 14px;
    font-weight: 600;
    color: #1e3a5f;
    min-width: 60px;
    text-align: right;
}

/* 로딩 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 30px;
    color: #666;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e8f4fd;
    border-top-color: #1e3a5f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 에러 */
.error {
    padding: 15px;
    background-color: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    font-size: 14px;
}

/* 유틸리티 */
.hidden {
    display: none !important;
}

/* 푸터 */
footer {
    background-color: #1e3a5f;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 20px;
    font-size: 13px;
}

/* 반응형 */
@media (max-width: 768px) {
    .result-item {
        flex-wrap: wrap;
        gap: 10px;
    }

    .probability {
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
    }

    .clause {
        min-width: auto;
    }
}
