/**
 * DarkFina - 옵션 분석 페이지 전용 스타일
 */

/* ========================================
   옵션 컨텐츠 영역
======================================== */
.options-content {
    display: flex;
    flex-direction: column;
}

.options-content > * {
    margin-bottom: 20px;
}

.options-content > *:last-child {
    margin-bottom: 0;
}

/* ========================================
   옵션 상태 카드
======================================== */
.options-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.options-stat-card {
    background: var(--df-bg-secondary);
    border: 1px solid var(--df-border);
    border-radius: 12px;
    padding: 20px;
}

.options-stat-card h4 {
    color: var(--df-cyan);
    margin-bottom: 16px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========================================
   Max Pain 카드
======================================== */
.max-pain-card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.05));
    border-color: rgba(255, 215, 0, 0.3);
}

.max-pain-value {
    font-size: 48px;
    font-weight: 700;
    color: #ffd700;
    text-align: center;
    margin: 20px 0;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.max-pain-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.max-pain-info .info-row {
    text-align: center;
    padding: 10px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    min-width: 0;
}

.max-pain-info .label {
    color: var(--df-text-secondary);
    font-size: 11px;
    margin-bottom: 4px;
}

.max-pain-info .value {
    font-size: 14px;
    font-weight: 600;
    word-break: break-word;
}

.max-pain-info .value.bullish {
    color: var(--df-green);
}

.max-pain-info .value.bearish {
    color: var(--df-pink);
}

/* ========================================
   P/C Ratio 그리드
======================================== */
.pc-ratio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.pc-item {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    padding: 12px 10px;
    text-align: center;
    min-width: 0;
}

.pc-item .label {
    color: var(--df-text-secondary);
    font-size: 11px;
    margin-bottom: 6px;
}

.pc-item .value {
    font-size: 18px;
    font-weight: 700;
    color: var(--df-cyan);
}

.pc-item .value.bullish {
    color: var(--df-green);
}

.pc-item .value.bearish {
    color: var(--df-pink);
}

/* ========================================
   AI 분석 섹션
======================================== */
.ai-analysis-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.ai-analysis-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.ai-analysis-header h4 {
    color: var(--df-cyan);
    margin: 0;
    flex: 1;
}

.ai-badge {
    font-size: 10px;
    color: #a78bfa;
    padding: 2px 8px;
    background: rgba(167, 139, 250, 0.15);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 4px;
    font-weight: 600;
}

.ai-refresh-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--df-border);
    border-radius: 50%;
    background: transparent;
    color: var(--df-text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-refresh-btn:hover {
    background: rgba(0, 212, 255, 0.1);
    color: var(--df-cyan);
    transform: rotate(180deg);
}

.ai-refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-analysis-content {
    color: #e2e8f0;
    font-size: 14px;
    line-height: 1.4;
    min-height: 100px;
}

.ai-analysis-content p {
    margin: 0 0 12px 0;
}

.ai-section {
    margin-bottom: 16px;
}

.ai-section-title {
    display: inline-block;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--df-cyan);
    margin-bottom: 8px;
}

.ai-section p {
    margin: 8px 0 0 0;
    padding-left: 4px;
}

.ai-analysis-footer {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 212, 255, 0.1);
    text-align: right;
}

.ai-timestamp {
    font-size: 11px;
    color: var(--df-text-muted);
}

.ai-cached-badge {
    font-size: 10px;
    color: #fbbf24;
    margin-right: 8px;
}

/* ========================================
   차트 컨테이너
======================================== */
.options-chart-container {
    background: var(--df-bg-secondary);
    border: 1px solid var(--df-border);
    border-radius: 12px;
    padding: 20px;
}

.options-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.options-chart-header h4 {
    color: var(--df-cyan);
    margin: 0;
}

.expiry-selector select {
    padding: 8px 16px;
    background: var(--df-bg-card);
    border: 1px solid var(--df-border);
    border-radius: 6px;
    color: var(--df-text-primary);
    font-size: 13px;
    cursor: pointer;
}

.expiry-selector select:focus {
    outline: none;
    border-color: var(--df-cyan);
}

/* ========================================
   옵션 체인 테이블
======================================== */
.chain-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.chain-header h4 {
    color: var(--df-cyan);
    margin: 0;
}

.chain-table {
    width: 100%;
    border-collapse: collapse;
}

.chain-table th {
    background: var(--df-bg-card);
    color: var(--df-cyan);
    padding: 12px;
    text-align: center;
    font-weight: 600;
    border-bottom: 2px solid var(--df-border);
    font-size: 13px;
}

.chain-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 13px;
    text-align: center;
}

.chain-table tr:hover {
    background: rgba(255, 215, 0, 0.05);
}

.chain-table .strike {
    font-weight: 700;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.chain-table .call-side {
    background: rgba(0, 255, 136, 0.03);
}

.chain-table .put-side {
    background: rgba(255, 51, 102, 0.03);
}

.chain-table .itm {
    background: rgba(255, 215, 0, 0.08) !important;
}

.chain-table .otm {
    background: transparent;
}

.chain-table .atm-row {
    background: rgba(255, 215, 0, 0.15) !important;
}

.chain-table .atm-row td {
    border-top: 2px solid #ffd700;
    border-bottom: 2px solid #ffd700;
}

.chain-table .strike.atm {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 165, 0, 0.2));
    font-size: 14px;
}

.chain-expiry-selector select {
    padding: 6px 12px;
    background: var(--df-bg-card);
    border: 1px solid var(--df-border);
    border-radius: 6px;
    color: var(--df-text-primary);
    font-size: 12px;
    cursor: pointer;
}

.itm-indicator {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 4px;
    font-size: 10px;
    color: #ffd700;
}

.otm-indicator {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    font-size: 10px;
    color: var(--df-text-secondary);
}

/* ========================================
   특이 옵션 거래
======================================== */
.unusual-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.unusual-disclaimer {
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 16px;
    font-size: 11px;
    color: #ffa500;
    line-height: 1.4;
}

.unusual-header h4 {
    color: var(--df-cyan);
    margin: 0;
}

.load-unusual-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border: none;
    border-radius: 6px;
    color: #000;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.load-unusual-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.load-unusual-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.unusual-table {
    width: 100%;
    border-collapse: collapse;
}

.unusual-table th {
    background: var(--df-bg-card);
    color: var(--df-cyan);
    padding: 10px;
    text-align: left;
    font-size: 12px;
}

.unusual-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 13px;
}

.unusual-table tr:hover {
    background: rgba(255, 215, 0, 0.05);
}

.vol-oi-high {
    color: #ffa500;
    font-weight: 700;
}

.vol-oi-extreme {
    color: #ff4444;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255, 68, 68, 0.5);
}

.option-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.option-type-call {
    background: rgba(0, 255, 136, 0.2);
    color: var(--df-green);
}

.option-type-put {
    background: rgba(255, 51, 102, 0.2);
    color: var(--df-pink);
}

.sentiment-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.sentiment-bullish {
    background: rgba(0, 255, 136, 0.2);
    color: var(--df-green);
}

.sentiment-bearish {
    background: rgba(255, 51, 102, 0.2);
    color: var(--df-pink);
}

.sentiment-neutral {
    background: rgba(128, 128, 128, 0.2);
    color: #888;
}

/* ========================================
   Greeks 섹션
======================================== */
.greeks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.greek-item {
    background: rgba(0, 212, 255, 0.05);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.greek-item .name {
    color: var(--df-cyan);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.greek-item .value {
    font-size: 20px;
    font-weight: 700;
    color: var(--df-text-primary);
}

.greek-item .description {
    font-size: 11px;
    color: var(--df-text-muted);
    margin-top: 4px;
}

/* ========================================
   IV 분석
======================================== */
.iv-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--df-border);
}

.iv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.iv-item {
    background: rgba(138, 43, 226, 0.05);
    border: 1px solid rgba(138, 43, 226, 0.2);
    border-radius: 8px;
    padding: 16px;
}

.iv-item .label {
    color: var(--df-text-secondary);
    font-size: 12px;
    margin-bottom: 4px;
}

.iv-item .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--df-purple);
}

.iv-item .percentile {
    font-size: 11px;
    color: var(--df-text-muted);
    margin-top: 4px;
}

/* ========================================
   로딩 상태
======================================== */
.options-loading {
    text-align: center;
    padding: 40px;
    color: var(--df-text-secondary);
}

.options-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--df-border);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

/* ========================================
   데이터 없음 상태
======================================== */
.no-data {
    text-align: center;
    padding: 40px;
    color: var(--df-text-muted);
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
}

.no-data-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ========================================
   반응형
======================================== */
@media (max-width: 768px) {
    .max-pain-value {
        font-size: 36px;
    }

    .max-pain-info {
        grid-template-columns: 1fr;
    }

    .pc-ratio-grid {
        grid-template-columns: 1fr;
    }
}
