/* Dashboard-specific styles extending the KRX base */

/* Lion API Status Indicator - Outer Circle like Mobile */
.lion-status-container {
    position: relative;
    display: inline-block;
}

.blue-lion-logo {
    border-radius: 50%;
    transition: all 0.3s ease;
}

.blue-lion-logo.api-connected {
    border: 4px solid #27ae60;
    box-shadow: 0 0 0 2px #27ae60, 0 4px 15px rgba(39, 174, 96, 0.3);
    animation: pulse-green-border 2s infinite;
}

.blue-lion-logo.api-disconnected {
    border: 4px solid #e74c3c;
    box-shadow: 0 0 0 2px #e74c3c, 0 4px 15px rgba(231, 76, 60, 0.3);
    animation: pulse-red-border 2s infinite;
}

@keyframes pulse-green-border {
    0% { 
        border-color: #27ae60;
        box-shadow: 0 0 0 2px #27ae60, 0 4px 15px rgba(39, 174, 96, 0.3), 0 0 0 0 rgba(39, 174, 96, 0.7);
    }
    70% { 
        border-color: #27ae60;
        box-shadow: 0 0 0 2px #27ae60, 0 4px 15px rgba(39, 174, 96, 0.3), 0 0 0 15px rgba(39, 174, 96, 0);
    }
    100% { 
        border-color: #27ae60;
        box-shadow: 0 0 0 2px #27ae60, 0 4px 15px rgba(39, 174, 96, 0.3), 0 0 0 0 rgba(39, 174, 96, 0);
    }
}

@keyframes pulse-red-border {
    0% { 
        border-color: #e74c3c;
        box-shadow: 0 0 0 2px #e74c3c, 0 4px 15px rgba(231, 76, 60, 0.3), 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% { 
        border-color: #e74c3c;
        box-shadow: 0 0 0 2px #e74c3c, 0 4px 15px rgba(231, 76, 60, 0.3), 0 0 0 15px rgba(231, 76, 60, 0);
    }
    100% { 
        border-color: #e74c3c;
        box-shadow: 0 0 0 2px #e74c3c, 0 4px 15px rgba(231, 76, 60, 0.3), 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

/* Enhanced metric cards with elevation */
.metric-card.elevated {
    background: #ffffff;
    border: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.05);
    transform: translateY(0);
    transition: all 0.3s ease;
}

.metric-card.elevated:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.1);
}

/* Enhanced analysis summary text size */
.analysis-summary h2 {
    font-size: 1.8em !important;
    font-weight: 700 !important;
    margin-bottom: 25px !important;
}

.analysis-summary .metric-value {
    font-size: 2.2em !important;
    font-weight: 800 !important;
}

.analysis-summary .metric-label {
    font-size: 1.1em !important;
    font-weight: 600 !important;
}

/* Enhanced analysis content text size */
.analysis-loaded p {
    font-size: 1.3em !important;
    font-weight: 600 !important;
    margin: 15px 0 !important;
    line-height: 1.4 !important;
}

.analysis-loaded strong {
    font-size: 1.1em !important;
    font-weight: 700 !important;
}

/* Navigation Bar */
.nav-bar {
    display: flex;
    background: #ffffff;
    border-bottom: 2px solid #dee2e6;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
    position: fixed;
    top: 25px;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-item {
    padding: 12px 20px;
    color: #1e40af;
    cursor: pointer;
    border-right: 1px solid #dee2e6;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 600;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    color: #0056b3;
}

.nav-item.active {
    background: #e9ecef;
    border-bottom: 3px solid #007bff;
    color: #007bff;
}

/* Dashboard Container */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 40px 20px 40px;
    background: #f8f9fa;
    min-height: calc(100vh - 120px);
}

/* Page Content */
.page-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.page-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Welcome Section */
.welcome-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 35px 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.welcome-header {
    display: flex;
    align-items: center;
    gap: 25px;
}

.blue-lion-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.3);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    object-fit: cover;
    flex-shrink: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blue-lion-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0,0,0,0.3);
}

.welcome-content {
    flex: 1;
}

.welcome-section h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.welcome-section p {
    font-size: 1.2em;
    margin-bottom: 25px;
    opacity: 0.9;
}

.quick-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #ff6b6b;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-primary:hover {
    background: #ee5a52;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Metrics Grid */
.overview-section {
    margin-bottom: 25px;
}

.overview-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}

.metric-card {
    background: white;
    padding: 22px 18px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-left: 5px solid #3498db;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.metric-label {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-bottom: 8px;
    font-weight: 600;
}

.metric-value {
    font-size: 2.2em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.metric-delta {
    font-size: 0.85em;
    color: #27ae60;
}

/* Analysis Summary */
.analysis-summary {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.analysis-summary h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.no-data-message {
    text-align: center;
    color: #7f8c8d;
    font-size: 1.1em;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.feature-section h3 {
    color: #34495e;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.feature-section ul {
    list-style: none;
    padding: 0;
}

.feature-section li {
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
    color: #5d6d7e;
    position: relative;
    padding-left: 20px;
}

.feature-section li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}

/* Top Recommendations */
.top-recommendations {
    background: white;
    padding: 25px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 25px;
}

.top-recommendations h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.top-stocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 8px;
}

.stock-card {
    background: #ffffff;
    padding: 0;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.02);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    overflow: hidden;
    position: relative;
}

.stock-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stock-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 8px 24px rgba(0,0,0,0.06);
    border-color: #cbd5e1;
}

.stock-card:hover::before {
    opacity: 1;
}

.stock-card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

.stock-card-rank {
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.stock-card h3 {
    color: #1e40af;
    margin: 0;
    font-size: 1.3em;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.stock-card-code {
    color: #1e40af;
    font-size: 0.9em;
    font-weight: 500;
    margin-top: 4px;
}

.stock-card-body {
    padding: 24px;
}

.stock-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 0;
}

.stock-metric {
    background: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.stock-metric:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

.stock-metric-label {
    font-size: 0.75em;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stock-metric-value {
    font-size: 1.4em;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.stock-score {
    background: #f8fafc;
    color: #1e293b;
    padding: 12px 20px;
    border-radius: 25px;
    text-align: center;
    margin-top: 20px;
    font-weight: 700;
    font-size: 1.1em;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Analysis Controls */
.analysis-controls {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
}

.control-info {
    flex: 1;
    min-width: 280px;
}

.control-info strong {
    color: #2c3e50;
    font-size: 1.2em;
    display: block;
    margin-bottom: 10px;
}

.control-info p {
    color: #7f8c8d;
    line-height: 1.5;
}

.control-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Analysis Progress */
.analysis-progress {
    background: white;
    padding: 25px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    text-align: center;
}

.progress-bar {
    background: #ecf0f1;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.progress-text {
    color: #34495e;
    font-weight: 600;
}

/* Analysis Results - Professional Design */
.analysis-results {
    background: #ffffff;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.04);
    margin-bottom: 40px;
    border: 1px solid rgba(255,255,255,0.8);
    position: relative;
    overflow: hidden;
}

.analysis-results::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(248, 249, 250, 0.5);
    border-radius: 50%;
    z-index: 0;
}

.analysis-results::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 200px;
    height: 200px;
    background: rgba(248, 249, 250, 0.5);
    border-radius: 50%;
    z-index: 0;
}

.info-message {
    text-align: center;
    color: #64748b;
    font-size: 1.2em;
    padding: 60px 20px;
    position: relative;
    z-index: 1;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-title {
    font-size: 1.5em;
    color: #2c3e50;
    font-weight: 600;
}

.results-summary {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.summary-item {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9em;
    color: #5d6d7e;
}

.stock-results {
    display: grid;
    gap: 15px;
}

.stock-result-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stock-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.1);
}

.stock-result-header {
    background: #34495e;
    color: white;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.stock-result-name {
    font-size: 1.4em;
    font-weight: 600;
}

.stock-result-score {
    background: #e74c3c;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.1em;
}

.stock-result-content {
    padding: 18px;
}

.stock-result-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.result-metric {
    text-align: center;
    padding: 10px;
}

.result-metric-label {
    font-size: 1.0em;
    color: #6c757d;
    margin-bottom: 6px;
    font-weight: 500;
}

.result-metric-value {
    font-size: 1.4em;
    font-weight: bold;
    color: #2c3e50;
}

/* Detailed Stock Information Styles */
.stock-detailed-info {
    margin-top: 25px;
    border-top: 2px solid #e9ecef;
    padding-top: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.stock-detailed-info h4 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.4em;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section {
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.detail-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: #2c3e50;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    font-size: 1.1em;
    line-height: 1.6;
}

.detail-grid > div {
    padding: 6px 0;
    border-bottom: 1px dotted #dee2e6;
}

.detail-grid > div:last-child,
.detail-grid > div:nth-last-child(2) {
    border-bottom: none;
}

.detail-grid span {
    font-weight: 600;
}

/* Enhanced Current Price Section */
.result-metric-primary {
    text-align: left;
    padding: 10px;
    display: flex;
    align-items: center;
}

.current-price-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.current-price-label {
    font-size: 0.9em;
    color: #6c757d;
    font-weight: 500;
}

.current-price-value {
    font-size: 1.4em;
    font-weight: bold;
    color: #2c3e50;
    letter-spacing: -0.5px;
}

/* Dropdown Toggle Styles */
.detail-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.detail-toggle:hover {
    background-color: #e9ecef;
}

.detail-toggle h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-icon {
    font-size: 1.2em;
    color: #3498db;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.detail-content {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        overflow: hidden;
    }
    to {
        opacity: 1;
        max-height: 2000px;
        overflow: visible;
    }
}

/* Responsive design for detail grid */
@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .stock-result-metrics {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }
    
    .current-price-value {
        font-size: 1.3em;
    }
}

/* Settings Styles */
.settings-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.settings-section {
    margin-bottom: 40px;
}

.settings-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item label {
    font-weight: 600;
    color: #34495e;
}

.setting-item input,
.setting-item select {
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1em;
}

.setting-item input:focus,
.setting-item select:focus {
    outline: none;
    border-color: #3498db;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.status-label {
    font-weight: 600;
    color: #34495e;
}

.status-value {
    font-weight: bold;
    color: #27ae60;
}

/* Stock Comparison Table Styles */
.comparison-table-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.1em;
    min-width: 1200px;
}

.comparison-table thead tr {
    background: #6c757d;
    color: white;
    text-align: center;
}

.comparison-table th {
    padding: 15px 8px;
    font-weight: 600;
    font-size: 1.0em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    border-right: 1px solid rgba(255,255,255,0.2);
    white-space: nowrap;
}

.comparison-table th:last-child {
    border-right: none;
}

.comparison-table tbody tr {
    background: white;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.3s ease;
}

.comparison-table tbody tr:hover {
    background: #f8f9fa;
}

.comparison-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.comparison-table tbody tr:nth-child(even):hover {
    background: #e9ecef;
}

.comparison-table td {
    padding: 12px 8px;
    text-align: center;
    border-right: 1px solid #e9ecef;
    font-size: 1.0em;
}

.comparison-table td:last-child {
    border-right: none;
}

/* Column specific styles */
.rank-col { width: 60px; }
.stock-name-col { 
    width: 120px; 
    text-align: left !important;
    font-weight: 600;
    color: inherit;
}
.price-col { width: 100px; }
.change-col { width: 90px; }
.high-col, .low-col { width: 100px; }
.marketcap-col { width: 100px; }
.per-col, .pbr-col { width: 80px; }
.volume-col { width: 100px; }
.revenue-col, .income-col { width: 100px; }
.margin-col, .roe-col { width: 90px; }
.score-col { 
    width: 80px;
    font-weight: bold;
    color: #e74c3c;
}

/* Value styling */
.positive-change {
    color: #e74c3c;
    font-weight: 600;
}

.negative-change {
    color: #2e5bba;
    font-weight: 600;
}

.high-score {
    background: #f8f9fa;
    color: #155724;
    font-weight: bold;
    border-radius: 4px;
    padding: 4px 8px;
}

.medium-score {
    background: #f8f9fa;
    color: #856404;
    font-weight: bold;
    border-radius: 4px;
    padding: 4px 8px;
}

.low-score {
    background: #f8f9fa;
    color: #721c24;
    font-weight: bold;
    border-radius: 4px;
    padding: 4px 8px;
}

.no-data-cell {
    text-align: center !important;
    padding: 40px 20px !important;
    color: #6c757d;
}

.loading-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loading-message p {
    margin: 0;
    font-size: 1.1em;
}

/* Table Legend */
.table-legend {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.table-legend h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
    text-align: left;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.legend-item {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    font-size: 0.95em;
    line-height: 1.4;
}

.legend-item strong {
    color: #2c3e50;
}

/* Stock Selector */
.stock-selector {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.stock-selector h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.stock-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1.1em;
    background: white;
}

.stock-select:focus {
    outline: none;
    border-color: #3498db;
}

/* Technical Details */
.technical-details {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    font-size: 1.2em;
    font-weight: 600;
}

/* Message Container */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9998;
}

.message {
    background: #2ecc71;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease-in-out;
}

.message.error-message {
    background: #e74c3c;
}

.message.warning-message {
    background: #f39c12;
}

.message.info-message {
    background: #3498db;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Quick Stock Buttons - Professional Design */
.quick-stock-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02), 0 1px 2px rgba(0,0,0,0.04);
}

.quick-stock-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(248, 249, 250, 0.5);
    transition: left 0.5s;
}

.quick-stock-btn:hover {
    background: #6c757d;
    border-color: #3b82f6;
    color: #ffffff;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.25), 0 4px 12px rgba(0,0,0,0.1);
}

.quick-stock-btn:hover::before {
    left: 100%;
}

.quick-stock-btn:active {
    transform: translateY(-1px) scale(1.01);
    transition: all 0.1s;
}

/* Individual Analysis Styles */
.individual-analysis-results {
    min-height: 300px;
}

.stock-analysis-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
    margin-bottom: 28px;
    border: 1px solid #e2e8f0;
    position: relative;
    transition: all 0.3s ease;
}

.stock-analysis-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.06);
}

.stock-analysis-header {
    background: #6c757d;
    color: white;
    padding: 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stock-analysis-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(248, 249, 250, 0.5);
    transition: left 0.6s;
}

.stock-analysis-header:hover::before {
    left: 100%;
}

.stock-analysis-title {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.stock-analysis-subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.stock-analysis-content {
    padding: 30px;
}

.analysis-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.analysis-metric-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid #3498db;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.analysis-metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.analysis-metric-label {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analysis-metric-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.analysis-metric-change {
    font-size: 0.9em;
    font-weight: 600;
}

.positive-change {
    color: #e74c3c;
}

.negative-change {
    color: #2e5bba;
}

.neutral-change {
    color: #7f8c8d;
}

/* Technical Analysis Section */
.technical-analysis-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 25px;
}

.technical-analysis-title {
    font-size: 1.6em;
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.technical-indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.technical-indicator {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.indicator-name {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 600;
}

.indicator-value {
    font-size: 1.4em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.indicator-signal {
    font-size: 0.8em;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    text-transform: uppercase;
}

.signal-buy {
    background: #d4edda;
    color: #155724;
}

.signal-sell {
    background: #f8d7da;
    color: #721c24;
}

.signal-hold {
    background: #fff3cd;
    color: #856404;
}

/* Chart Section */
.chart-integration-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 25px;
}

.chart-header {
    background: #6c757d;
    color: white;
    padding: 20px;
    text-align: center;
}

.chart-iframe {
    width: 100%;
    height: 500px;
    border: none;
    background: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-bar {
        flex-wrap: wrap;
    }
    
    .dashboard-container {
        padding: 15px;
    }
    
    .welcome-section {
        padding: 25px;
        text-align: center;
    }
    
    .welcome-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .blue-lion-logo {
        width: 80px;
        height: 80px;
    }
    
    .welcome-section h1 {
        font-size: 2em;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .control-row {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .quick-actions {
        justify-content: center;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .comparison-table {
        font-size: 0.8em;
    }
    
    .comparison-table th {
        padding: 10px 4px;
        font-size: 0.8em;
    }
    
    .comparison-table td {
        padding: 8px 4px;
        font-size: 0.8em;
    }
    
    .legend-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================
   모니터링 페이지 스타일
   ========================= */

/* 모니터링 컨테이너 */
.monitoring-content {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    min-height: 500px;
}

/* 모니터링 통계 카드 */
.monitoring-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.stat-card.profit {
    border-left: 4px solid #10b981;
}

.stat-card.loss {
    border-left: 4px solid #ef4444;
}

.stat-card.average {
    border-left: 4px solid #8b5cf6;
}

.stat-icon {
    font-size: 2em;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.stat-label {
    color: #64748b;
    font-size: 0.9em;
    font-weight: 600;
}

/* 모니터링 목록 섹션 */
.monitoring-list-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header h2 {
    color: #1e293b;
    margin: 0;
    font-size: 1.5em;
    font-weight: 700;
}

.list-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn.secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn.secondary:hover {
    background: #e2e8f0;
    color: #334155;
}

.auto-refresh {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-refresh input[type="checkbox"] {
    margin: 0;
}

.auto-refresh label {
    font-size: 0.9em;
    color: #64748b;
    font-weight: 500;
    margin: 0;
}

/* 모니터링 목록 */
.monitoring-list {
    min-height: 200px;
}

.empty-monitoring {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-icon {
    font-size: 4em;
    margin-bottom: 16px;
}

.empty-monitoring p {
    margin: 8px 0;
    font-size: 1.1em;
}

/* 모니터링 종목 카드는 JavaScript에서 인라인으로 스타일 적용됨 */

/* 반응형 디자인 */
@media (max-width: 768px) {
    .monitoring-stats {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .list-controls {
        justify-content: center;
    }
    
    .stat-card {
        padding: 20px;
    }
}

/* =========================
   모니터링 페이지 강제 표시
   ========================= */

/* 모니터링 페이지 강제 표시 */
#monitoring-page {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1 !important;
}

/* 디버깅을 위한 임시 스타일 */
#monitoring-page.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: #f8f9fa !important;
    min-height: 500px !important;
}

/* 모니터링 페이지 내용 요소들 강제 표시 */
#monitoring-page .welcome-section,
#monitoring-page .monitoring-stats,
#monitoring-page .monitoring-list,
#monitoring-page h1,
#monitoring-page h2,
#monitoring-page p,
#monitoring-page div {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}