/* Stock Performance Analyzer Styles */

.spa-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Search Section */
.spa-search-section {
    text-align: center;
    margin-bottom: 30px;
}

.spa-title {
    font-size: 28px;
    color: #1a237e;
    margin-bottom: 8px;
}

.spa-subtitle {
    color: #666;
    font-size: 15px;
    margin-bottom: 20px;
}

.spa-search-box {
    display: flex;
    justify-content: center;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

.spa-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
    text-transform: uppercase;
}

.spa-input:focus {
    border-color: #3f51b5;
}

.spa-button {
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background-color: #3f51b5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.spa-button:hover {
    background-color: #283593;
}

.spa-button:disabled {
    background-color: #9fa8da;
    cursor: not-allowed;
}

/* Error Message */
.spa-error {
    margin-top: 15px;
    padding: 12px 20px;
    background-color: #ffebee;
    color: #c62828;
    border-radius: 8px;
    font-size: 14px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Loading */
.spa-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.spa-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #3f51b5;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spa-spin 0.8s linear infinite;
}

@keyframes spa-spin {
    to { transform: rotate(360deg); }
}

/* Results Header */
.spa-results-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e8eaf6;
}

.spa-results-header h3 {
    font-size: 24px;
    color: #1a237e;
    margin: 0;
}

.spa-price-badge {
    background: #e8eaf6;
    color: #283593;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
}

/* Summary Cards */
.spa-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 35px;
}

.spa-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.spa-card h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #3f51b5;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8eaf6;
}

.spa-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spa-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.spa-metric-label {
    font-size: 13px;
    color: #666;
}

.spa-metric-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.spa-metric-value.positive {
    color: #2e7d32;
}

.spa-metric-value.negative {
    color: #c62828;
}

.spa-card-unavailable {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px 10px;
    font-size: 13px;
}

/* Charts */
.spa-chart-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.spa-chart-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.spa-chart-wrapper {
    position: relative;
    height: 350px;
}

.spa-chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Period Buttons */
.spa-period-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.spa-period-btn {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.spa-period-btn:hover {
    border-color: #3f51b5;
    color: #3f51b5;
}

.spa-period-btn.active {
    background: #3f51b5;
    border-color: #3f51b5;
    color: #fff;
}

/* Data Table */
.spa-table-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.spa-table-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.spa-table {
    width: 100%;
    font-size: 14px;
}

.spa-table th {
    background: #3f51b5;
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
}

.spa-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.spa-table tr:hover td {
    background-color: #f5f5f5;
}

.spa-positive { color: #2e7d32; font-weight: 600; }
.spa-negative { color: #c62828; font-weight: 600; }

/* Responsive */
@media (max-width: 768px) {
    .spa-cards-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .spa-search-box {
        flex-direction: column;
    }

    .spa-results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .spa-chart-wrapper {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .spa-cards-container {
        grid-template-columns: 1fr;
    }

    .spa-title {
        font-size: 22px;
    }
}
