/* KRX-style interface CSS - Professional Korean financial website styling */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: '돋움', Dotum, 'Malgun Gothic', sans-serif;
    font-size: 10pt;
    background-color: white;
    color: #333;
    line-height: 1.5;
}

/* Header styling matching KRX design */
.top-header {
    background: #6c757d;
    height: 25px;
    position: relative;
    border-bottom: 1px solid #495057;
}

.header-content {
    color: white;
    font-size: 11px;
    font-weight: bold;
    position: absolute;
    left: 20px;
    top: 6px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.header-close {
    position: absolute;
    right: 10px;
    top: 2px;
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
}

.header-close:hover {
    background-color: rgba(255,255,255,0.2);
    border-radius: 2px;
}

/* Breadcrumb navigation */
.breadcrumb-bar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 5px 20px;
    font-size: 8pt;
}

.breadcrumb-bar a {
    color: #666;
    text-decoration: none;
}

.breadcrumb-bar a:hover {
    color: #495057;
    text-decoration: underline;
}

.breadcrumb-bar .current {
    color: #333;
    font-weight: bold;
}

/* Search area */
.search-area {
    background: #ffffff;
    border-bottom: 1px solid #dee2e6;
    padding: 8px 20px;
    position: relative;
}

.search-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-label {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 4px 8px;
    font-size: 10pt;
    font-weight: bold;
    color: #495057;
    width: 60px;
    text-align: center;
    border-radius: 2px;
}

.search-input {
    border: 1px solid #dee2e6;
    padding: 3px 5px;
    font-size: 10pt;
    width: 200px;
    font-family: inherit;
    border-radius: 2px;
}

.search-input:focus {
    outline: none;
    border-color: #6c757d;
    box-shadow: 0 0 3px rgba(108, 117, 125, 0.3);
}

.btn-search, .btn-close {
    padding: 3px 12px;
    font-size: 10pt;
    cursor: pointer;
    font-family: inherit;
    border-radius: 2px;
    border: 1px solid;
}

.btn-search {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-search:hover {
    background: #5a6268;
}

.btn-close {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
    margin-left: 3px;
}

.btn-close:hover {
    background: #5a6268;
}

/* Auto-complete suggestion box */
.suggestion-box {
    position: absolute;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 200px;
    margin-left: 69px; /* Align with search input */
    margin-top: -1px;
}

.suggestion-item {
    padding: 6px 8px;
    cursor: pointer;
    font-size: 8pt;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Main container */
.main-container {
    padding: 15px 18px;
    background-color: white;
    position: relative;
}

.time-info {
    text-align: right;
    font-size: 8pt;
    color: #666;
    margin-bottom: 10px;
}

/* Stock header */
.stock-header {
    margin-bottom: 15px;
}

.stock-name {
    font-size: 14pt;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.stock-price-info {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.current-price {
    font-size: 18pt;
    font-weight: bold;
    color: #c41e3a;
}

.price-change {
    font-size: 11pt;
    font-weight: bold;
}

.price-change.up {
    color: #c41e3a;
}

.price-change.down {
    color: #2e5bba;
}

/* Main layout */
.main-layout {
    display: flex;
    gap: 20px;
}

.left-panel {
    width: 380px;
    flex-shrink: 0;
}

.right-panel {
    flex: 1;
    min-width: 0;
}

/* Information table */
.info-table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 15px;
    font-size: 9pt;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.info-table td, .info-table th {
    border: 1px solid #ccc;
    padding: 3px 5px;
    height: 22px;
}

.info-table th {
    background: #f8f9fa;
    font-weight: bold;
    text-align: center;
    color: #495057;
}

.info-table td {
    text-align: right;
    background-color: white;
}

.info-table .label-cell {
    background: #f8f9fa;
    font-weight: bold;
    text-align: center;
    color: #495057;
}

.info-table .highlight-red {
    color: #c41e3a;
    font-weight: bold;
}

/* Chart container */
.chart-container {
    border: 1px solid #ccc;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-tabs {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    padding: 0;
}

.chart-tab {
    padding: 6px 12px;
    border-right: 1px solid #ccc;
    cursor: pointer;
    font-size: 8pt;
    background: inherit;
    color: #666;
    transition: all 0.2s ease;
}

.chart-tab:hover {
    background: #e9ecef;
    color: #495057;
}

.chart-tab.active {
    background: white;
    color: #333;
    font-weight: bold;
    border-bottom: 1px solid white;
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}

.chart-content {
    height: 400px;
    background-color: white;
    position: relative;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 100;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Message styles */
.message {
    padding: 8px 12px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 9pt;
    font-weight: bold;
}

.info-message {
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.success-message {
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.error-message {
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

/* Responsive design */
@media (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
    }
    
    .left-panel {
        width: 100%;
    }
    
    .search-input {
        width: 150px;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 10px 15px;
    }
    
    .stock-price-info {
        flex-direction: column;
        gap: 5px;
    }
    
    .current-price {
        font-size: 16pt;
    }
    
    .search-row {
        flex-wrap: wrap;
        gap: 3px;
    }
    
    .search-input {
        width: 120px;
    }
    
    .suggestion-box {
        margin-left: 0;
        width: 100%;
    }
}

/* Score calculation system styling */
.score-explanation {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.score-explanation .indicator-box {
    border-left: none !important;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
    background-color: white;
}

.score-explanation .technical-analysis .indicator-box,
.score-explanation .fundamental-analysis .indicator-box {
    border-left: none !important;
}

/* Loading spinner animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Portfolio Monitor animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}