/* 정부사업 통합검색 시스템 - CSS 스타일 */

/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    min-height: 100vh;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 8px;
}

@media (min-width: 768px) {
    .container {
        padding: 15px;
        max-width: 1600px;
    }
}

/* 헤더 스타일 */
header {
    margin-bottom: 10px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 50%, #5c6bc0 100%);
    color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(26, 35, 126, 0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    text-align: left;
    flex: 1;
}

header h1 {
    font-size: 1.1rem;
    margin-bottom: 2px;
    font-weight: 700;
}

header p {
    font-size: 0.7rem;
    opacity: 0.85;
}

/* 알림 버튼 */
.notification-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 50px;
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.notification-btn:active {
    transform: scale(0.95);
}

.notification-btn #notifIcon {
    font-size: 1.3rem;
}

.notification-btn .notif-status {
    font-size: 0.6rem;
    font-weight: bold;
    margin-top: 2px;
}

.notification-btn.enabled {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.6);
}

.notification-btn.enabled .notif-status {
    color: #a5d6a7;
}

.notification-btn.disabled {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.4);
    opacity: 0.7;
}

.notification-btn.disabled .notif-status {
    color: #ef9a9a;
}

.notification-btn.unsupported {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 헤더 액션 버튼 그룹 */
.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 로그인 버튼 */
.login-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 50px;
    color: white;
    font-size: 1rem;
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.login-btn:active {
    transform: scale(0.95);
}

.login-btn span:first-child {
    font-size: 1.3rem;
}

.login-btn .login-text {
    font-size: 0.6rem;
    font-weight: bold;
    margin-top: 2px;
}

/* 로그인된 상태 */
.login-btn.logged-in {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.6);
}

.login-btn.logged-in .login-text {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 사용자 메뉴 드롭다운 */
.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
}

.user-menu-header {
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.user-menu-header strong {
    display: block;
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.user-menu-header small {
    display: block;
    color: #666;
    font-size: 0.75rem;
}

.user-menu-items {
    padding: 8px 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.user-menu-item:hover {
    background: #f8f9fa;
}

.header-actions {
    position: relative;
}

/* 로그인 모달 스타일 */
.login-modal-content {
    max-width: 400px;
    padding: 0;
    overflow: hidden;
}

.login-modal-header {
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.login-modal-header h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.login-modal-header p {
    opacity: 0.85;
    font-size: 0.9rem;
}

#loginForm {
    padding: 25px 20px 15px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #3949ab;
    box-shadow: 0 0 0 3px rgba(57, 73, 171, 0.1);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.remember-me input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.forgot-password {
    color: #3949ab;
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

.login-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.login-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.3);
}

.login-submit-btn:active {
    transform: translateY(0);
}

.login-divider {
    display: flex;
    align-items: center;
    padding: 0 20px;
    margin: 10px 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.login-divider span {
    padding: 0 15px;
    color: #888;
    font-size: 0.85rem;
}

.social-login {
    padding: 0 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.social-btn.kakao {
    background: #FEE500;
    color: #3C1E1E;
}

.social-btn.naver {
    background: #03C75A;
    color: white;
}

.login-footer {
    padding: 15px 20px 20px;
    text-align: center;
    background: #f8f9fa;
    font-size: 0.9rem;
}

.login-footer a {
    color: #3949ab;
    font-weight: 600;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

@media (min-width: 768px) {
    header {
        margin-bottom: 12px;
        padding: 12px 15px;
        border-radius: 10px;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    header p {
        font-size: 0.8rem;
    }
}

/* 검색 섹션 */
.search-section {
    background: white;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 모바일: 입력란 */
.search-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

/* 모바일: 버튼 그룹 */
.search-buttons-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

#searchKeyword {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.3s ease;
    min-height: 36px;
    min-width: 0;
}

#searchBtn, .search-btn-main {
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 36px;
    flex: 0 0 auto;
    white-space: nowrap;
    line-height: 1.2;
}

.secondary-btn {
    background: linear-gradient(135deg, #5c6bc0 0%, #7986cb 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 36px;
    flex: 0 0 auto;
    white-space: nowrap;
    line-height: 1.2;
}

.secondary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(92, 107, 192, 0.3);
}

.secondary-btn:active {
    transform: scale(0.98);
}

#searchKeyword:focus {
    outline: none;
    border-color: #3949ab;
    box-shadow: 0 0 0 4px rgba(57, 73, 171, 0.1);
}

#searchBtn {
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 38px;
    flex: 0 0 auto;
    white-space: pre-wrap;
    line-height: 1.2;
}

#searchBtn:active {
    transform: scale(0.98);
}

/* 검색 결과 숫자 표시 */
.search-result-count {
    display: none;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    background: #e8eaf6;
    color: #3949ab;
    white-space: nowrap;
    align-self: center;
    flex-shrink: 0;
    min-width: auto;
    max-width: 80px;
}

.search-result-count.has-results {
    background: #e8f5e9;
    color: #2e7d32;
}

.search-result-count.no-results {
    background: #ffebee;
    color: #c62828;
}

@media (min-width: 768px) {
    .search-section {
        padding: 15px;
        flex-direction: column;
        gap: 12px;
    }
    
    .search-input-wrapper {
        width: 100%;
        margin-bottom: 0;
    }
    
    .search-buttons-wrapper {
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
    }
    
    #searchKeyword {
        flex: 1;
        min-width: 300px;
        padding: 10px 14px;
        font-size: 15px;
        min-height: 42px;
    }
    
    #searchBtn, .search-btn-main {
        white-space: nowrap;
        padding: 10px 20px;
        font-size: 15px;
        min-height: 42px;
    }
    
    .secondary-btn {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 42px;
    }

    #searchBtn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(26, 35, 126, 0.4);
    }
    
    .type-filters {
        margin-top: 0;
        margin-bottom: 0;
    }
}

/* 검색 도움말 */
.search-help {
    padding: 6px 10px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 6px;
    font-size: 0.75rem;
    color: #1565c0;
    margin-bottom: 8px;
    border-left: 3px solid #1976d2;
}

.search-help strong {
    color: #0d47a1;
}

/* 유형 필터 - 버튼 스타일 */
.type-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 0 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    width: 100%;
}

.type-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 18px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    color: #495057;
}

.type-filter-btn:hover {
    border-color: #3949ab;
    background: #f0f4ff;
}

.type-filter-btn.active {
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(26, 35, 126, 0.3);
}

.type-filter-btn .filter-icon {
    font-size: 0.85rem;
}

.type-filter-btn .filter-name {
    font-weight: 500;
}

.type-filter-btn .filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 700;
}

.type-filter-btn.active .filter-count {
    background: rgba(255, 255, 255, 0.3);
}

/* 레거시 체크박스 스타일 (호환성) */
.type-filter {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.type-filter input[type="checkbox"] {
    display: none;
}

.filter-label {
    padding: 5px 10px;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.type-filter input[type="checkbox"]:checked + .filter-label {
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
    color: white;
    border-color: transparent;
}

.type-filter:hover .filter-label {
    border-color: #3949ab;
}

/* 검색 옵션 버튼 */
.search-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.secondary-btn, .link-btn {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex: 1;
    min-width: 50px;
    white-space: pre-wrap;
    line-height: 1.1;
}

/* 24시간 신규 버튼 강조 */
.new-items-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    border: none;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.new-items-btn:active {
    background: linear-gradient(135deg, #ee5a5a 0%, #dd4a4a 100%);
    transform: scale(0.98);
}

@media (min-width: 768px) {
    .new-items-btn:hover {
        background: linear-gradient(135deg, #ff5252 0%, #e53935 100%);
        box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    }
}

.secondary-btn:active, .link-btn:active {
    background: #e9ecef;
}

@media (min-width: 768px) {
    .secondary-btn:hover, .link-btn:hover {
        background: #e9ecef;
        border-color: #adb5bd;
    }
}

/* 면허 필터 카드 */
.license-filter-card {
    margin-top: 12px;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.license-filter-toggle {
    width: 100%;
    background: transparent;
    border: none;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    border-radius: 12px;
}

.license-filter-toggle:focus-visible {
    outline: 2px solid #4a90d9;
    outline-offset: 2px;
}

.license-filter-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-align: left;
}

.license-filter-title {
    font-weight: 600;
    font-size: 1rem;
    color: #1f3c88;
}

.license-filter-summary {
    font-size: 0.85rem;
    color: #495057;
}

.license-filter-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #495057;
}

.license-filter-chevron {
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

.license-filter-panel {
    border-top: 1px solid #f1f3f5;
    padding: 16px;
    background: #f9fbff;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.license-filter-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.license-table-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.license-table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.license-table-wrapper {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    background: white;
}

.license-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.license-table thead {
    position: sticky;
    top: 0;
    background: #f5f7fb;
    z-index: 1;
}

.license-table th,
.license-table td {
    padding: 10px;
    border-bottom: 1px solid #f1f3f5;
    text-align: left;
}

.license-table tbody tr:hover {
    background: #f9fbff;
}

.license-table-checkbox {
    width: 48px;
    text-align: center;
}

.license-table-checkbox input {
    width: 16px;
    height: 16px;
}

.license-category-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3949ab;
    font-size: 0.8rem;
    font-weight: 600;
}

.license-filter-inputs,
.license-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.license-filter-inputs input,
.license-keyword-input {
    flex: 1;
    min-width: 160px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #ced4da;
    font-size: 0.9rem;
}

.license-keyword-input {
    max-width: 220px;
}

.license-switch {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    color: #495057;
}

.license-switch input {
    width: 16px;
    height: 16px;
}

.license-search-btn {
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.license-search-btn:active {
    transform: scale(0.98);
}

@media (min-width: 768px) {
    .license-filter-toolbar {
        flex-direction: column;
    }

    .license-filter-options {
        align-items: center;
    }

    .license-search-btn:hover {
        box-shadow: 0 6px 12px rgba(57, 73, 171, 0.25);
    }
}

.license-feedback {
    font-size: 0.85rem;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #edf2ff;
    color: #1f3c88;
}

.license-feedback[data-type="success"] {
    background: #e6f4ea;
    color: #1b5e20;
}

.license-feedback[data-type="error"] {
    background: #ffe8e8;
    color: #b71c1c;
}

.license-feedback[data-type="info"] {
    background: #edf2ff;
    color: #1f3c88;
}

.license-category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.license-category-card {
    background: white;
    border-radius: 4px;
    border: 1px solid #e8e8e8;
    padding: 0;
    margin-bottom: 2px;
}

.license-category-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 3px 8px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    border-left: 3px solid #667eea;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.category-icon {
    font-size: 14px;
}

.category-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #333;
    flex: 1;
}

.category-text strong {
    font-size: 12px;
    color: #333;
    font-weight: 500;
}

.category-count {
    font-size: 11px;
    color: #888;
    margin-left: auto;
}

.license-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.license-chip {
    border: 1px solid #d0d7de;
    background: #f8f9fa;
    color: #495057;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.license-chip.selected {
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(57, 73, 171, 0.3);
}

.license-chip:focus-visible {
    outline: 2px solid #4a90d9;
    outline-offset: 2px;
}

.license-empty {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 0.9rem;
}

/* PWA 모드 특별 스타일 */
body.pwa-mode header {
    padding-top: max(env(safe-area-inset-top), 10px);
}

body.pwa-mode .container {
    padding-bottom: max(env(safe-area-inset-bottom), 10px);
}

/* 통계 섹션 */
.stats-section {
    margin-bottom: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.stat-card {
    background: white;
    padding: 8px 10px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
    border-left: 3px solid #ccc;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card:active {
    transform: scale(0.95);
}

.stat-card.active {
    box-shadow: 0 0 0 2px #1976d2;
}

.stat-card.bid { border-left-color: #1976d2; }
.stat-card.rnd { border-left-color: #7b1fa2; }
.stat-card.sme { border-left-color: #388e3c; }
.stat-card.subsidy { border-left-color: #f57c00; }
.stat-card.bizinfo { border-left-color: #00796b; }
.stat-card.all { border-left-color: #455a64; }

.stat-icon {
    font-size: 1rem;
}

.stat-count {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a237e;
}

.stat-label {
    font-size: 0.7rem;
    color: #6c757d;
    display: none;
}

@media (min-width: 768px) {
    .stat-label {
        display: inline;
    }
}

/* 로딩 스타일 */
.loading {
    text-align: center;
    padding: 30px 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3949ab;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 결과 섹션 */
.results-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.results-header {
    padding: 10px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.results-header h2 {
    color: #1a237e;
    font-size: 1rem;
    font-weight: 600;
}

.results-info {
    font-size: 0.85rem;
    color: #6c757d;
}

#resultsCount {
    font-weight: 700;
    color: #1a237e;
    font-size: 1rem;
}

/* 결과 그리드 */
.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
}

@media (min-width: 768px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1100px) {
    .results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .results-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 결과 카드 */
.result-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: transparent;
}

.result-card.bid { border-left: 4px solid #1976d2; }
.result-card.rnd { border-left: 4px solid #7b1fa2; }
.result-card.sme_support { border-left: 4px solid #388e3c; }
.result-card.subsidy { border-left: 4px solid #f57c00; }
.result-card.bizinfo { border-left: 4px solid #00796b; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.type-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
}

.type-badge.bid { background: #1976d2; }
.type-badge.bid_purchase { background: #1976d2; }
.type-badge.bid_service { background: #1976d2; }
.type-badge.rnd { background: #7b1fa2; }
.type-badge.sme_support { background: #388e3c; }
.type-badge.subsidy { background: #f57c00; }
.type-badge.success_bid { background: #e91e63; }
.type-badge.success_bid_service { background: #e91e63; }
.type-badge.success_bid_purchase { background: #e91e63; }
.type-badge.bizinfo { background: #00796b; }

/* 상태 배지 (헤더용) */
.status {
    padding: 2px 6px;
    background: #f1f3f4;
    border-radius: 8px;
    font-size: 0.65rem;
    color: #6c757d;
}

.status.active {
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 600;
}

.status.canceled {
    background: #ffebee;
    color: #c62828;
}

/* 상세보기 버튼 (작은 버전) */
.btn-detail-sm {
    padding: 2px 8px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.65rem;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-detail-sm:hover {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
}

.deadline {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
}

.deadline.soon {
    color: #d32f2f;
    font-weight: 700;
    animation: pulse 2s infinite;
}

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

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    word-break: keep-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.75rem;
    line-height: 1.4;
}

.info-label {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.info-value {
    color: #495057;
    flex: 1;
    word-break: break-word;
}

.info-value strong {
    color: #333;
    font-weight: 600;
}

.info-value.budget {
    color: #d32f2f;
    font-weight: 600;
}

.info-value.id-value {
    font-family: monospace;
    font-size: 0.7rem;
    color: #666;
    background: #f5f5f5;
    padding: 1px 4px;
    border-radius: 3px;
}

.info-value.email-value {
    color: #1976d2;
    font-size: 0.7rem;
}

/* 카드 크기 확장 */
.result-card {
    min-height: auto;
}

.result-card .card-info {
    max-height: none;
}

/* 결과 없음 */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #495057;
}

.no-results .hint {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #9e9e9e;
}

/* 에러 메시지 */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #ef9a9a;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.error-icon {
    font-size: 1.5rem;
}

/* 숨김 클래스 */
.hidden {
    display: none !important;
}

/* 모달 스타일 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 1000;
    padding: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
    .modal {
        align-items: center;
        padding: 30px;
    }
    
    .modal-content {
        max-width: 900px;
        width: 90%;
        max-height: 90vh;
        margin: 0;
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
    color: white;
    border-radius: 16px 16px 0 0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.modal-title-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-title-area .type-badge {
    align-self: flex-start;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.3;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.2s;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 10;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.close-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.4);
}

.modal-body {
    padding: 20px;
}

@media (min-width: 768px) {
    .modal-header {
        padding: 25px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 30px;
    }
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

@media (min-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.detail-section {
    background: #f8f9fa;
    padding: 18px;
    border-radius: 10px;
    border-left: 4px solid #3949ab;
}

.detail-section.full-width {
    grid-column: 1 / -1;
}

.detail-section h3 {
    margin: 0 0 15px 0;
    color: #1a237e;
    font-size: 1rem;
    font-weight: 600;
}

.detail-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.detail-item label {
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.detail-item span {
    color: #333;
    word-break: break-word;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .detail-item {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .detail-item label {
        min-width: 90px;
        margin-right: 15px;
        margin-bottom: 0;
    }
    
    .detail-item span {
        flex: 1;
    }
}

.detail-content {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    color: #495057;
    line-height: 1.6;
}

.extra-info-list {
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 15px;
}

.extra-info-item {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.extra-info-item:last-child {
    border-bottom: none;
}

/* 첨부파일 스타일 */
.attachments-list {
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 15px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f3f4;
}

.attachment-item:last-child {
    border-bottom: none;
}

.attachment-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.attachment-name {
    flex: 1;
    color: #555;
    font-size: 0.9rem;
    word-break: break-all;
}

.attachment-name-text {
    flex: 1;
    color: #333;
    font-size: 0.9rem;
    word-break: break-all;
    margin-right: 8px;
}

.attachment-name-link {
    flex: 1;
    color: #2196F3;
    font-size: 0.9rem;
    word-break: break-all;
    margin-right: 8px;
    text-decoration: none;
    cursor: pointer;
}

.attachment-name-link:hover {
    text-decoration: underline;
    color: #1976D2;
}

.attachment-view-btn,
.attachment-download-btn,
.attachment-convert-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 1rem;
    margin-left: 4px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.attachment-view-btn {
    background: #e3f2fd;
    border: 1px solid #90caf9;
}

.attachment-view-btn:hover {
    background: #bbdefb;
}

.attachment-convert-btn {
    background: #fff3e0;
    border: 1px solid #ffcc80;
}

.attachment-convert-btn:hover {
    background: #ffe0b2;
}

.attachment-convert-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.attachment-download-btn {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
}

.attachment-download-btn:hover {
    background: #eeeeee;
}

.attachment-link {
    flex: 1;
    color: #1a73e8;
    font-size: 0.9rem;
    text-decoration: none;
    word-break: break-all;
    transition: color 0.2s;
}

.attachment-link:hover {
    color: #1557b0;
    text-decoration: underline;
}

.attachment-link:active {
    color: #0d47a1;
}

.download-icon {
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.open-icon {
    font-size: 0.9rem;
    opacity: 0.6;
    margin-left: 4px;
}

.attachment-item:hover .download-icon,
.attachment-item:hover .open-icon {
    opacity: 1;
}

/* 모바일 터치 영역 확대 */
@media (max-width: 767px) {
    .attachment-item {
        padding: 14px 0;
        min-height: 48px;
    }
    
    .attachment-link {
        font-size: 1rem;
    }
}

/* 첨부파일 다운로드 안내 */
.attachments-notice {
    margin-top: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 1px solid #ffb74d;
    border-radius: 8px;
    color: #e65100;
    font-size: 0.85rem;
    line-height: 1.5;
    display: none;
}

.extra-label {
    font-weight: 600;
    color: #6c757d;
    min-width: 100px;
    font-size: 0.9rem;
}

.extra-value {
    flex: 1;
    color: #333;
    font-size: 0.9rem;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

@media (min-width: 768px) {
    .modal-actions {
        flex-direction: row;
        justify-content: flex-end;
        gap: 15px;
    }
}

.action-btn {
    padding: 14px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    text-align: center;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn.primary {
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
    color: white;
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 35, 126, 0.4);
}

.action-btn.secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.action-btn.secondary:hover {
    background: #e9ecef;
}

/* 푸터 */
footer {
    text-align: center;
    margin-top: 20px;
    padding: 15px 10px;
    color: #6c757d;
    border-top: 1px solid #dee2e6;
    font-size: 0.75rem;
}

footer p {
    margin-bottom: 3px;
}

footer .data-sources {
    margin: 8px 0;
}

footer .data-sources a {
    color: #4a90d9;
    text-decoration: none;
    transition: color 0.2s;
}

footer .data-sources a:hover {
    color: #2d6cb5;
    text-decoration: underline;
}

footer .api-notice {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-top: 5px;
}

footer p:last-child {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* 데이터 출처 표시 스타일 */
.data-source-row {
    background: rgba(74, 144, 217, 0.08);
    border-radius: 4px;
    padding: 2px 4px;
    margin-bottom: 4px;
}

.data-source {
    color: #4a90d9;
    font-size: 0.75rem;
    font-weight: 500;
}

/* 면허 정보 표시 스타일 */
.license-info {
    background: rgba(40, 167, 69, 0.08);
    border-radius: 4px;
    padding: 2px 4px;
    margin-bottom: 4px;
    border-left: 3px solid #28a745;
}

.license-info .info-value {
    color: #1e7e34;
    font-weight: 500;
}

/* 추가 모바일 최적화 */
@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    header {
        padding: 8px;
    }
    
    header h1 {
        font-size: 1rem;
    }
    
    header p {
        font-size: 0.65rem;
    }
    
    .search-section {
        padding: 10px;
    }
    
    .type-filters {
        padding: 6px;
    }
    
    .filter-label {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
    
    .stats-grid {
        gap: 5px;
    }
    
    .stat-card {
        padding: 6px;
    }
    
    .stat-count {
        font-size: 1rem;
    }
    
    .results-grid {
        padding: 8px;
        gap: 8px;
    }
    
    .result-card {
        padding: 10px;
    }
    
    .card-title {
        font-size: 0.85rem;
    }
}

/* 알림 권한 요청 프롬프트 */
.notification-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 8px 0;
    font-size: 14px;
    flex-wrap: wrap;
}

.notification-prompt button {
    background: white;
    color: #667eea;
    border: none;
    padding: 6px 14px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
}

.notification-prompt button:last-child {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* ============================================
   면허 필터 - 카테고리별 그리드 스타일 (컴팩트)
   ============================================ */

.license-filter-toolbar-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.license-filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.license-select-all-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.license-select-all-btn:hover {
    background: #5a6fd6;
}

.license-select-all-btn.active {
    background: #4caf50;
}

.license-select-all-btn input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.license-categories-wrapper {
    max-height: none;
    overflow-y: visible;
    padding: 4px;
    background: #fff;
    border-radius: 4px;
}

.license-category-section {
    margin-bottom: 2px;
    background: white;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.license-category-header {
    background: #f8f8f8;
    color: #333;
    padding: 2px 6px;
    border-bottom: 1px solid #e8e8e8;
    border-left: 3px solid #667eea;
}

.category-select-all {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-weight: 500;
    font-size: 12px;
    justify-content: flex-start;
    width: 100%;
}

.category-select-all input[type="checkbox"] {
    width: 13px;
    height: 13px;
    cursor: pointer;
}

.category-icon {
    font-size: 13px;
}

.category-name {
    margin-right: auto;
    text-align: left;
}

.category-count {
    font-size: 11px;
    color: #888;
    margin-left: auto;
}

.license-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    padding: 4px;
}

@media (max-width: 1200px) {
    .license-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .license-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .license-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .license-grid {
        grid-template-columns: 1fr;
    }
}

.license-item {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 4px 6px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 11px;
    min-height: 24px;
}

.license-item.selected {
    background: #e3f2fd;
    border-color: #1976d2;
    box-shadow: 0 0 0 1px rgba(25, 118, 210, 0.3);
}

.license-item input[type="checkbox"] {
    width: 12px;
    height: 12px;
    cursor: pointer;
    flex-shrink: 0;
}

.license-name {
    font-size: 11px;
    color: #333;
    line-height: 1.3;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}

.license-empty {
    text-align: center;
    padding: 15px;
    color: #666;
    font-size: 13px;
}

.license-search-btn {
    display: none !important;
}

/* 피드백 메시지 숨기기 */
.license-feedback {
    display: none !important;
}

/* 선택된 면허 표시 영역 */
.license-selected-box {
    background: #f0f7ff;
    border: 1px solid #b3d4fc;
    border-radius: 4px;
    padding: 6px 10px;
    margin-top: 8px;
    font-size: 12px;
    color: #1565c0;
    line-height: 1.5;
}

.license-selected-box.hidden {
    display: none;
}

.license-selected-box .label {
    font-weight: 600;
    margin-right: 6px;
}

.license-selected-box .items {
    color: #333;
}

/* 접힌 상태에서 상단에 보이는 선택 요약 */
.license-filter-summary {
    font-size: 12px;
    color: #666;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ===========================================================================
   문서 요약 모달 스타일
   =========================================================================== */

.summary-modal-content {
    max-width: 700px;
}

.summary-badge {
    background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
}

/* 요약 버튼 */
.attachment-summary-btn {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
    margin-left: 6px;
    transition: all 0.2s ease;
}

.attachment-summary-btn:hover {
    background: linear-gradient(135deg, #6d28d9, #9333ea);
    transform: scale(1.1);
}

.attachment-summary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 로딩 스피너 */
.summary-loading {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #7c3aed;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-subtext {
    color: #9ca3af;
    font-size: 13px;
    margin-top: 8px;
}

/* 요약 내용 */
.summary-content {
    padding: 10px 0;
}

.summary-text {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.7;
    max-height: 400px;
    overflow-y: auto;
}

.summary-text h3 {
    color: #1f2937;
    font-size: 16px;
    margin: 16px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e5e7eb;
}

.summary-text h3:first-child {
    margin-top: 0;
}

.summary-text h4 {
    color: #374151;
    font-size: 14px;
    margin: 12px 0 6px;
}

.summary-text ul {
    margin: 8px 0;
    padding-left: 20px;
}

.summary-text li {
    margin: 4px 0;
}

.summary-text strong {
    color: #1f2937;
}

.summary-text p {
    margin: 8px 0;
}

/* 요약 메타 정보 */
.summary-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    font-size: 12px;
    color: #6b7280;
}

.cached-badge {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

/* 요약 에러 */
.summary-error {
    text-align: center;
    padding: 30px 20px;
    color: #dc2626;
}

.summary-error p:first-child {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

#summaryErrorText {
    color: #6b7280;
    font-size: 13px;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .summary-modal-content {
        margin: 10px;
        max-height: 90vh;
    }
    
    .summary-text {
        max-height: 300px;
        font-size: 13px;
    }
    
    .attachment-summary-btn {
        padding: 6px 10px;
        font-size: 16px;
    }
}

/* PDF 뷰어 모달 */
.pdf-viewer-content {
    max-width: 95vw;
    max-height: 95vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.pdf-viewer-body {
    padding: 0;
    flex: 1;
    min-height: 400px;
    max-height: calc(95vh - 150px);
    background: #525659;
    border-radius: 0;
    position: relative;
    overflow: hidden;
}

.pdf-viewer-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

#pdfViewerContainer {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0;
    box-sizing: border-box;
}

/* 변환 방법 선택 버튼 스타일 */
.conversion-method-btn {
    padding: 15px;
    text-align: left;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.conversion-method-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.conversion-method-btn:active {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .pdf-viewer-content {
        max-width: 90vw;
        max-height: 90vh;
    }
    
    .pdf-viewer-body {
        max-height: calc(90vh - 180px);
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .pdf-viewer-content {
        margin: 5px;
        max-height: 95vh;
    }
    
    .pdf-viewer-body {
        max-height: calc(95vh - 140px);
        min-height: 300px;
    }
}

/* 면허필터 슬라이드 패널 스타일 */
.license-panel-overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.license-panel-overlay.open {
    opacity: 1;
    visibility: visible;
}

.license-slide-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 10001;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.license-slide-panel.open {
    transform: translateX(0);
}

/* 데스크톱: 오른쪽 일부를 덮는 형태 (리사이징 가능) */
@media (min-width: 769px) {
    .license-slide-panel {
        width: 40%;
        min-width: 350px;
        max-width: 800px;
        position: relative;
    }
    
    /* 리사이징 핸들 (왼쪽 경계) */
    #resizeHandle {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 8px;
        cursor: col-resize;
        background: linear-gradient(90deg, rgba(102, 126, 234, 0.5) 0%, rgba(102, 126, 234, 0.2) 100%);
        transition: background 0.2s ease;
        z-index: 10002;
    }
    
    #licensePanel:hover #resizeHandle {
        background: linear-gradient(90deg, rgba(102, 126, 234, 0.8) 0%, rgba(102, 126, 234, 0.4) 100%);
    }
}

/* 태블릿: 화면의 절반 */
@media (min-width: 481px) and (max-width: 768px) {
    .license-slide-panel {
        width: 100%;
    }
}

/* 모바일: 전체 화면 */
@media (max-width: 480px) {
    .license-slide-panel {
        width: 100%;
    }
}

.license-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-shrink: 0;
}

.license-panel-header h3 {
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
}

.license-panel-header .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    min-width: auto;
}

.license-panel-header .close-btn:hover {
    opacity: 0.8;
}

.license-panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.license-panel-content * {
    word-break: break-word;
    overflow-wrap: break-word;
}

.license-panel-footer {
    padding: 15px;
    border-top: 2px solid #f0f0f0;
    background: #f9f9f9;
    flex-shrink: 0;
}

.license-panel-footer .complete-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.license-panel-footer .complete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.license-panel-footer .complete-btn:active {
    transform: translateY(0);
}

/* 검색 버튼 스타일 조정 (개행 처리) */
#searchBtn,
.secondary-btn,
.license-filter-btn {
    white-space: pre-wrap;
    line-height: 1.2;
    min-height: 50px;
    padding: 8px 12px;
}

.license-filter-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.license-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.license-filter-btn:active {
    transform: translateY(0);
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .license-slide-panel {
        width: 100%;
    }
}