/* Dashboard Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8fafc;
    color: #334155;
}

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

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.header h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: 700;
}

.header p {
    margin: 10px 0 0 0;
    opacity: 0.9;
    font-size: 1.1em;
}

.nav {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.nav a {
    color: #667eea;
    text-decoration: none;
    margin-right: 15px;
    padding: 12px 20px;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 500;
}

.nav a:hover, .nav a.active {
    background-color: #667eea;
    color: white;
    transform: translateY(-2px);
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.card h2 {
    margin: 0 0 20px 0;
    color: #1e293b;
    font-size: 1.5em;
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.status-success {
    background-color: #dcfce7;
    color: #166534;
}

.status-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.status-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.metric-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #cbd5e1;
}

.metric-value {
    font-size: 2em;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 5px;
}

.metric-label {
    color: #64748b;
    font-size: 0.9em;
    font-weight: 500;
}

.report-list {
    display: grid;
    gap: 15px;
}

.report-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.report-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.report-id {
    font-weight: 600;
    color: #1e293b;
}

.report-timestamp {
    color: #64748b;
    font-size: 0.9em;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.summary-item {
    text-align: center;
}

.summary-value {
    font-size: 1.2em;
    font-weight: 600;
    color: #1e293b;
}

.summary-label {
    font-size: 0.8em;
    color: #64748b;
    text-transform: uppercase;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.error {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.back-button {
    background-color: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 20px;
}

.back-button:hover {
    background-color: #5a67d8;
}

.refresh-btn {
    background-color: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 20px;
}

.refresh-btn:hover {
    background-color: #5a67d8;
}

/* Ticker Analysis Styles */
.search-box {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.search-box:focus {
    outline: none;
    border-color: #667eea;
}

.filter-buttons, .sort-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.filter-btn, .sort-btn {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.filter-btn:hover, .sort-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active, .sort-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.sort-label {
    font-weight: 600;
    color: #64748b;
    margin-right: 10px;
}

.ticker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.ticker-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ticker-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.ticker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ticker-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.2em;
}

.ticker-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.metric:last-child {
    border-bottom: none;
}

.metric .label {
    font-size: 0.9em;
    color: #64748b;
    font-weight: 500;
}

.metric .value {
    font-weight: 600;
    color: #1e293b;
}

.no-data {
    text-align: center;
    color: #64748b;
    font-style: italic;
    padding: 40px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.page-btn {
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.page-btn.active {
    background-color: #667eea;
    color: white;
}

/* AI Rating Breakdown Styles */
.breakdown-details {
    margin-top: 8px;
    padding: 8px;
    background-color: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.breakdown-label {
    font-size: 0.85em;
    color: #64748b;
    font-weight: 500;
    text-transform: capitalize;
}

.breakdown-value {
    font-size: 0.85em;
    color: #1e293b;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .metric-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .ticker-grid {
        grid-template-columns: 1fr;
    }
}
