* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.last-updated {
    color: #888;
    font-size: 0.9rem;
    font-style: italic;
}

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

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

/* Sidebar Styles */
.sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.sidebar h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

.card h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Score Display */
.score-display {
    text-align: center;
    margin-bottom: 30px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.score-circle:hover {
    transform: scale(1.05);
}

.score-aaa { background: linear-gradient(135deg, #4CAF50, #45a049); }
.score-aa { background: linear-gradient(135deg, #8BC34A, #689F38); }
.score-a { background: linear-gradient(135deg, #FFC107, #FF8F00); }
.score-bbb { background: linear-gradient(135deg, #FF9800, #F57C00); }
.score-bb { background: linear-gradient(135deg, #FF5722, #D84315); }
.score-b { background: linear-gradient(135deg, #F44336, #C62828); }

.score-numeric {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 10px;
}

.score-change {
    font-weight: bold;
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
}

.score-change.positive {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.score-change.negative {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

/* Issuer Selector */
.issuer-selector {
    margin-bottom: 30px;
}

.issuer-selector select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.issuer-selector select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Data Sources */
.data-sources {
    margin-bottom: 30px;
}

.data-source {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.data-source:hover {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    padding-left: 10px;
    padding-right: 10px;
}

.data-source:last-child {
    border-bottom: none;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 10px;
    animation: pulse 2s infinite;
}

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

.status-online { background: #4CAF50; }
.status-offline { background: #f44336; }
.status-warning { background: #FF9800; }

.update-time {
    font-size: 0.8rem;
    color: #888;
}

/* Feature Importance */
.feature-importance {
    margin-bottom: 20px;
}

.feature-bar {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    transition: transform 0.2s ease;
}

.feature-bar:hover {
    transform: translateX(5px);
}

.feature-name {
    min-width: 150px;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.bar-container {
    flex: 1;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 15px;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s ease;
    position: relative;
}

.bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: slide 2s infinite;
}

@keyframes slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.bar-positive { background: linear-gradient(135deg, #4CAF50, #45a049); }
.bar-negative { background: linear-gradient(135deg, #f44336, #d32f2f); }

.feature-value {
    min-width: 60px;
    text-align: right;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Chart Container */
.chart-container {
    height: 300px;
    margin-bottom: 20px;
    position: relative;
}

.chart-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.time-filter {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.time-filter:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.time-filter.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Bottom Section */
.bottom-section {
    display: grid;
    grid-template-columns: 1fr 300px 300px;
    gap: 20px;
}

@media (max-width: 1024px) {
    .bottom-section {
        grid-template-columns: 1fr;
    }
}

/* Events Feed */
.events-feed {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f1f1;
}

.events-feed::-webkit-scrollbar {
    width: 6px;
}

.events-feed::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.events-feed::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.event-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.event-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

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

.event-time {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 5px;
}

.event-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.event-impact {
    font-size: 0.9rem;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    font-weight: 500;
}

.impact-positive {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.impact-negative {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.impact-neutral {
    background: rgba(158, 158, 158, 0.1);
    color: #666;
}

/* Performance Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.metric {
    text-align: center;
    padding: 20px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.metric:hover {
    transform: scale(1.05);
}

.metric-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.metric-label {
    color: #666;
    font-size: 0.9rem;
}

/* Risk Factors */
.risk-factors {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.risk-factor {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.risk-factor:hover {
    background: rgba(102, 126, 234, 0.05);
}

.risk-name {
    font-weight: 500;
    color: #333;
}

.risk-level {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.risk-low {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.risk-medium {
    background: rgba(255, 152, 0, 0.1);
    color: #FF9800;
}

.risk-high {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

/* Quick Actions */
.quick-actions {
    margin-top: 20px;
}

.action-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

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

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover {
    color: #333;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

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

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-overlay p {
    color: #666;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .dashboard {
        gap: 20px;
    }
    
    .bottom-section {
        gap: 15px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* Feature Explanation Tooltip */
.feature-explanation {
    position: relative;
    cursor: help;
}

.feature-explanation::after {
    content: attr(data-explanation);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.feature-explanation:hover::after {
    opacity: 1;
}

/* Animation for new data */
.data-update {
    animation: highlight 1s ease;
}

@keyframes highlight {
    0% { background: rgba(102, 126, 234, 0.3); }
    100% { background: transparent; }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for better accessibility */
button:focus,
select:focus,
input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .action-btn {
        display: none;
    }
}