/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #1a1a2e;
    color: #eaeaea;
    min-height: 100vh;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2rem;
    color: #00d4ff;
}

/* Input Section */
.input-section {
    background: #16213e;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.ticker-inputs,
.level-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: flex-end;
}

.ticker-inputs {
    margin-bottom: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    font-size: 0.85rem;
    color: #888;
}

.input-group input {
    padding: 10px 15px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #0f0f23;
    color: #fff;
    font-size: 1rem;
    width: 120px;
}

.input-group input:focus {
    outline: none;
    border-color: #00d4ff;
}

.fetch-btn {
    padding: 10px 30px;
    background: #00d4ff;
    color: #000;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.fetch-btn:hover {
    background: #00a8cc;
}

.fetch-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

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

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Error */
.error {
    background: #ff4444;
    color: #fff;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Summary Table */
.summary-section {
    background: #16213e;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.summary-section h2 {
    margin-bottom: 15px;
    color: #00d4ff;
}

#summaryTable {
    width: 100%;
    border-collapse: collapse;
}

#summaryTable th,
#summaryTable td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #333;
}

#summaryTable th {
    background: #0f0f23;
    color: #00d4ff;
}

#summaryTable tr:hover {
    background: rgba(0, 212, 255, 0.1);
}

.price-current { color: #fff; font-weight: bold; }
.price-strike { color: #ff4444; }
.price-call { color: #4444ff; }
.price-airbag { color: #ff8c00; }

/* Charts Section */
.charts-section {
    background: #16213e;
    border-radius: 10px;
    padding: 20px;
}

.charts-section h2 {
    margin-bottom: 15px;
    color: #00d4ff;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.chart-container {
    background: #0f0f23;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 280px;
}

.chart-container:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 5px;
}

.chart-ticker {
    font-weight: bold;
    font-size: 1.1rem;
}

.chart-price {
    color: #00d4ff;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #16213e;
    border-radius: 10px;
    padding: 20px;
    width: 90vw;
    height: 85vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
}

.modal-close:hover {
    color: #ff4444;
}

#modalChart {
    flex: 1;
    min-height: 0;
}

.modal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 15px 0;
    justify-content: center;
    font-size: 0.9rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-line {
    width: 30px;
    height: 3px;
}

.legend-line.dashed {
    background: repeating-linear-gradient(
        90deg,
        currentColor,
        currentColor 5px,
        transparent 5px,
        transparent 10px
    );
    height: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .ticker-inputs,
    .level-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-group input {
        width: 100%;
    }
}
