/* 전체 레이아웃 */
body {
    font-size: 0.95rem;
    background-color: #f8f9fa;
}

/* 사이드바 스타일 */
.sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    overflow-y: auto;
}

.sidebar-heading {
    font-size: .75rem;
    text-transform: uppercase;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 0.5rem 1rem;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

.sidebar .nav-link.active {
    color: #007bff;
    background-color: #e7f3ff;
    border-left-color: #007bff;
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
}

/* 메인 컨텐츠 */
main {
    padding-top: 56px;
    min-height: 100vh;
}

/* 취약점 배지 */
.severity-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.severity-critical {
    background-color: #dc3545;
    color: white;
}

.severity-high {
    background-color: #fd7e14;
    color: white;
}

.severity-medium {
    background-color: #ffc107;
    color: #000;
}

.severity-low {
    background-color: #28a745;
    color: white;
}

/* 용어 툴팁 */
.term-highlight {
    border-bottom: 1px dotted #007bff;
    cursor: help;
    color: #007bff;
    font-weight: 500;
}

.term-tooltip {
    position: relative;
    display: inline-block;
}

/* 실습 카드 */
.exercise-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.exercise-card.completed {
    border-left: 4px solid #28a745;
}

.difficulty-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.difficulty-초급 {
    background-color: #d1ecf1;
    color: #0c5460;
}

.difficulty-중급 {
    background-color: #fff3cd;
    color: #856404;
}

.difficulty-고급 {
    background-color: #f8d7da;
    color: #721c24;
}

/* 프롬프트 입력 영역 */
.prompt-input-area {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.prompt-textarea {
    min-height: 150px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* 응답 영역 */
.response-area {
    background-color: #2d2d2d;
    color: #f8f8f2;
    border-radius: 0.5rem;
    padding: 1.5rem;
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.response-area:empty::before {
    content: "여기에 Ollama의 응답이 표시됩니다...";
    color: #6c757d;
    font-style: italic;
}

/* 로딩 스피너 */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 힌트 영역 */
.hint-area {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0.25rem;
}

.hint-item {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.hint-item::before {
    content: "💡";
    position: absolute;
    left: 0;
}

/* 정답 영역 */
.answer-area {
    background-color: #d1ecf1;
    border-left: 4px solid #17a2b8;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0.25rem;
}

.answer-code {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

/* 시나리오 카드 */
.scenario-card {
    border-left: 4px solid #6c757d;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
}

/* 방어 기법 리스트 */
.prevention-list {
    list-style: none;
    padding-left: 0;
}

.prevention-list li {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: #d4edda;
    border-left: 4px solid #28a745;
    border-radius: 0.25rem;
}

.prevention-list li::before {
    content: "✓ ";
    color: #28a745;
    font-weight: bold;
    margin-right: 0.5rem;
}

/* 용어 사전 */
.terms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.term-card {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.term-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.term-card-title {
    font-weight: bold;
    color: #007bff;
    margin-bottom: 0.5rem;
}

.term-card-ko {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

/* Ollama 상태 표시 */
#ollama-status.connected {
    background-color: #28a745;
}

#ollama-status.disconnected {
    background-color: #dc3545;
}

#ollama-status i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 진행도 체크박스 */
.completion-checkbox {
    margin-right: 0.5rem;
}

/* 버튼 스타일 */
.btn-group-custom {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-hint {
    background-color: #ffc107;
    color: #000;
}

.btn-hint:hover {
    background-color: #e0a800;
}

.btn-answer {
    background-color: #17a2b8;
    color: white;
}

.btn-answer:hover {
    background-color: #138496;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .sidebar {
        position: relative;
        top: 0;
    }
    
    main {
        padding-top: 0;
    }
    
    .terms-grid {
        grid-template-columns: 1fr;
    }
}

/* 코드 블록 스타일 개선 */
pre[class*="language-"] {
    border-radius: 0.5rem;
    margin: 1rem 0;
}

/* 스크롤바 스타일 */
.sidebar::-webkit-scrollbar,
.response-area::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.response-area::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb,
.response-area::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.response-area::-webkit-scrollbar-thumb:hover {
    background: #555;
}
