/* JY Stock Chart Plugin Styles */

.jy-stock-chart-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin: 20px 0;
}

/* Loading */
.jy-loading {
    text-align: center;
    padding: 60px 20px;
}

.jy-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Stock Header */
.jy-stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
}

.jy-stock-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.jy-stock-logo {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: contain;
}

.jy-stock-name {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.jy-stock-code {
    margin: 5px 0 0 0;
    font-size: 14px;
    color: #666;
}

.jy-stock-price-wrapper {
    text-align: right;
}

.jy-current-price {
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

.jy-price-change {
    font-size: 16px;
    margin-top: 5px;
}

.jy-price-change.positive {
    color: #10b981;
}

.jy-price-change.negative {
    color: #ef4444;
}

/* Tabs */
.jy-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
}

.jy-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.jy-tab:hover {
    color: #333;
}

.jy-tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

/* Tab Panels */
.jy-tab-panel {
    display: none;
}

.jy-tab-panel.active {
    display: block;
}

/* Info Cards */
.jy-overview-grid,
.jy-fundamentals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.jy-info-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.jy-info-card h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.jy-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.jy-info-row:last-child {
    border-bottom: none;
}

.jy-info-label {
    color: #666;
    font-size: 14px;
}

.jy-info-value {
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

/* Chart */
.jy-chart-controls {
    margin-bottom: 20px;
}

.jy-timeframe-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.jy-timeframe-btn {
    padding: 8px 16px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.jy-timeframe-btn:hover {
    background: #e0e0e0;
}

.jy-timeframe-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.jy-chart-wrapper {
    position: relative;
    height: 400px;
    margin-top: 20px;
}

/* Financial Statements */
.jy-financials-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.jy-financial-tab {
    padding: 10px 20px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.jy-financial-tab:hover {
    background: #e0e0e0;
}

.jy-financial-tab.active {
    background: #3498db;
    color: white;
}

.jy-financial-statements table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.jy-financial-statements th,
.jy-financial-statements td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.jy-financial-statements th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.jy-financial-statements td {
    color: #666;
}

/* Error */
.jy-error {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
}

.jy-error-message {
    color: #c00;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .jy-stock-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .jy-stock-price-wrapper {
        text-align: left;
    }
    
    .jy-overview-grid,
    .jy-fundamentals-grid {
        grid-template-columns: 1fr;
    }
    
    .jy-tabs {
        flex-wrap: wrap;
    }
    
    .jy-tab {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Stock Price Widget */
.jy-stock-price-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin: 20px 0;
}

.jy-stock-price-widget .jy-price-main {
    display: flex;
    align-items: baseline;
    gap: 15px;
    margin-bottom: 20px;
}

.jy-stock-price-widget .jy-current-price {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

.jy-stock-price-widget .jy-price-change {
    font-size: 18px;
    font-weight: 600;
}

.jy-stock-price-widget .jy-price-change.positive {
    color: #22c55e;
}

.jy-stock-price-widget .jy-price-change.negative {
    color: #ef4444;
}

.jy-price-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.jy-price-table th,
.jy-price-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.jy-price-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.jy-price-table td {
    font-size: 16px;
    color: #111827;
}

.jy-volume-display {
    font-size: 14px;
    color: #6b7280;
    padding: 10px 0;
}

.jy-volume-display span:first-child {
    font-weight: 600;
}
