/* JSL Stock Chart Custom Styles - Matching Image Design */

.stock-chart-wrapper {
    background: #ffffff;
    border: 2px solid #ef7f1a;
    border-radius: 8px;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Exchange Switcher */
.stock-exchange-switcher {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: #f3f4f6;
    border-radius: 6px;
    padding: 4px;
    width: fit-content;
}

.exchange-radio {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.exchange-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.exchange-radio span {
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.2s;
    user-select: none;
}

.exchange-radio input[type="radio"]:checked + span {
    background: #ffffff;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.exchange-radio input[type="radio"]:checked + span::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef7f1a;
    margin-right: 8px;
}

/* Stock Header */
.stock-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.stock-title-section {
    flex: 1;
    min-width: 200px;
}

.stock-company-name {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.stock-price-display {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stock-current-price {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

.stock-price-change-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stock-price-change {
    font-size: 16px;
    font-weight: 600;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stock-price-change::before {
    content: "↑";
    font-size: 14px;
}

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

.stock-price-change.negative::before {
    content: "↓";
}

.stock-price-change-percent {
    font-size: 16px;
    font-weight: 600;
    color: #10b981;
}

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

.stock-date-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 14px;
    color: #6b7280;
}

#jsl-stock-status {
    font-weight: 500;
}

/* Chart Canvas Wrapper */
.stock-chart-canvas-wrapper {
    position: relative;
    height: 400px;
    margin: 20px 0;
    background: #ffffff;
}

#jsl-stock-chart-canvas {
    width: 100% !important;
    height: 100% !important;
}

.stock-chart-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #6b7280;
    font-size: 14px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #ef7f1a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Period Selector */
.stock-period-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.stock-period-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stock-period-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.stock-period-btn.active {
    background: #ef7f1a;
    color: #ffffff;
    border-color: #ef7f1a;
    font-weight: 600;
}

.stock-period-btn.active:hover {
    background: #d97316;
    border-color: #d97316;
}

.stock-period-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stock-chart-header {
        flex-direction: column;
    }
    
    .stock-date-section {
        align-items: flex-start;
    }
    
    .stock-current-price {
        font-size: 24px;
    }
    
    .stock-chart-canvas-wrapper {
        height: 300px;
    }
    
    .stock-period-selector {
        gap: 6px;
    }
    
    .stock-period-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}
