* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    color: #2c3e50;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Breadcrumb Navigation */
.breadcrumb {
    margin-bottom: 20px;
    padding: 10px 0;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.breadcrumb .separator {
    margin: 0 8px;
    color: #bdc3c7;
}

.breadcrumb .current {
    color: #7f8c8d;
}

header {
    margin-bottom: 40px;
    background: white;
    padding: 40px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-bottom: 3px solid #3498db;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

.header-text {
    text-align: left;
}

.header-text h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 600;
}

.header-text p {
    font-size: 1rem;
    color: #7f8c8d;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.multi-btn {
    padding: 12px 24px;
    background: #27ae60;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    min-height: 48px; /* 터치 친화적 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.multi-btn:hover {
    background: #229954;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.search-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

#krCodeInput, #ob-krCodeInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #fff;
}

#krCodeInput:focus, #ob-krCodeInput:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#searchBtn, #ob-searchBtn {
    padding: 12px 24px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#searchBtn:hover, #ob-searchBtn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

#searchBtn:active, #ob-searchBtn:active {
    transform: translateY(0);
}

.search-examples {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.error h3 {
    color: #e53e3e;
    margin-bottom: 10px;
    font-weight: 600;
}

.bond-info {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.bond-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.bond-header h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.6rem;
    font-weight: 600;
}

.kr-code {
    color: #7f8c8d;
    font-size: 0.9rem;
    font-weight: 500;
    background: #f8f9fa;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.info-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-left: 4px solid #3498db;
    transition: all 0.2s ease;
}

.info-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.info-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.info-content {
    color: #555;
}

.date-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.day-of-week {
    color: #3498db;
    font-weight: 600;
    font-size: 1rem;
    background: #e3f2fd;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

.day-of-week.holiday {
    color: #e74c3c;
    background: #ffeaea;
    border: 1px solid #e74c3c;
}

.credit-ratings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.rating-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.rating-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.9rem;
}

.rating-value {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1rem;
    background: #e8f5e8;
    padding: 2px 8px;
    border-radius: 4px;
}

.additional-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.9rem;
}



footer {
    text-align: center;
    color: #7f8c8d;
    margin-top: 40px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.hidden {
    display: none !important;
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }
    
    header p {
        font-size: 0.9rem;
    }
    
    .search-box {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-box input {
        font-size: 16px; /* iOS 줌 방지 */
        padding: 12px 16px;
        min-height: 48px; /* 터치 친화적 */
    }
    
    .search-box button {
        min-height: 48px;
        font-size: 16px;
        padding: 12px 24px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .credit-ratings {
        grid-template-columns: 1fr;
    }
}

/* 사자/팔자 버튼 스타일 */
.trade-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.trade-btn {
    padding: 12px 24px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    min-height: 48px; /* 터치 친화적 */
    background: white;
}

.buy-btn {
    color: #27ae60;
    border-color: #27ae60;
}

.buy-btn:hover {
    background: #27ae60;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.sell-btn {
    color: #e74c3c;
    border-color: #e74c3c;
}

.sell-btn:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.trade-btn.selected {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

/* 가격 입력 필드 스타일 */
.price-inputs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.price-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.price-input-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.price-input-group input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.2s ease;
    background: white;
}

.price-input-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.price-input-group input::placeholder {
    color: #9ca3af;
    font-size: 0.8rem;
}

/* 라디오 버튼 스타일 */
.name-option {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.credit-option {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #6c757d;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.toggle-label:hover {
    background: #f8f9fa;
}

.toggle-label input[type="radio"] {
    margin: 0;
    accent-color: #3498db;
}

/* 복사 버튼 스타일 */
.copy-btn {
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.copy-btn:active {
    transform: translateY(0);
}

/* 생성된 텍스트 영역 스타일 */
.generated-text {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #e9ecef;
}

.text-display {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

#textContent {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    color: #2c3e50;
    word-break: break-all;
}

/* 복수 종목 페이지 스타일 */
.multi-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.input-section {
    margin-bottom: 30px;
}

.input-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
}

.input-area {
    position: relative;
}

#krCodesInput, #m-krCodesInput {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: border-color 0.2s ease;
}

#krCodesInput:focus, #m-krCodesInput:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.input-info {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #3498db;
}

.input-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
}

.action-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.trade-options h3,
.name-options h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.generate-section {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.generate-btn {
    padding: 15px 40px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.generate-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.generate-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.results {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.results-header h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.results-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.copy-all-btn {
    padding: 8px 16px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-all-btn:hover {
    background: #229954;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

#resultCount {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.result-item:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.result-text {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #2c3e50;
    word-break: break-all;
}

.result-copy {
    padding: 6px 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.result-copy:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.result-copy:active {
    transform: translateY(0);
}

.error-item {
    background: #fff5f5;
    border-color: #fed7d7;
}

.error-text {
    color: #e53e3e;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .header-text {
        text-align: center;
    }
    
    .action-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .results-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .price-inputs {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .price-input-group {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .price-input-group label {
        min-width: 40px;
        text-align: left;
    }
    
    .price-input-group input {
        width: 100px;
    }
}

/* 발행사 검색 페이지 스타일 */
.search-inputs {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.input-group input {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.search-results {
    margin-top: 30px;
}

.results-header {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.results-header h2 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.results-info {
    color: #6c757d;
    font-size: 0.9rem;
}

.results-info p {
    margin: 5px 0;
}

.bonds-list {
    display: grid;
    gap: 15px;
}

.bond-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bond-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.bond-item-content {
    flex: 1;
}

.bond-main-info h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.bond-kr-code {
    margin: 0 0 10px 0;
    color: #27ae60;
    font-weight: 600;
    font-size: 0.9rem;
}

.bond-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.bond-details p {
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
}

.select-bond-btn {
    padding: 10px 20px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.select-bond-btn:hover {
    background: #219a52;
}

/* 메시지 스타일 */
.message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
}

.message.loading {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.message.success {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #bbdefb;
    border-top: 2px solid #1976d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 히스토리 드롭다운 스타일 */
.input-with-dropdown {
    position: relative;
    flex: 1;
    min-width: 0; /* flex item이 축소되지 않도록 */
}

.input-with-dropdown input {
    width: 100%;
    box-sizing: border-box;
}

.history-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
}

.dropdown-header {
    padding: 10px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    color: #666;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
}

.dropdown-items {
    max-height: 120px;
    overflow-y: auto;
}

/* 스크롤바 스타일링 */
.dropdown-items::-webkit-scrollbar {
    width: 4px;
}

.dropdown-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.dropdown-items::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.dropdown-items::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    display: block;
    transition: background-color 0.2s;
    min-height: 32px;
    line-height: 1.4;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.dropdown-item .kr-code {
    font-weight: 600;
    color: #2c5530;
    font-size: 13px;
    margin-right: 12px;
    pointer-events: none;
}

.dropdown-item .bond-name {
    color: #666;
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
    pointer-events: none;
}

.dropdown-item .maturity {
    color: #666;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
}

/* 발행사 검색 페이지 반응형 */
@media (max-width: 768px) {
    .search-inputs {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .input-group input {
        font-size: 16px; /* iOS 줌 방지 */
        padding: 12px 16px;
        min-height: 48px;
    }
    
    .search-btn {
        min-height: 48px;
        font-size: 16px;
        padding: 12px 24px;
    }
    
    .bond-item {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .bond-details {
        grid-template-columns: 1fr;
    }
    
    .select-bond-btn {
        align-self: stretch;
        min-height: 48px;
        font-size: 16px;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .header-actions .multi-btn {
        width: 100%;
        justify-content: center;
    }
    
    .price-inputs {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .price-input-group input {
        min-height: 48px;
        font-size: 16px;
    }
    
    .trade-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .trade-buttons .trade-btn {
        width: 100%;
        min-height: 52px;
        font-size: 1.2rem;
    }
}
