/* 225opfast.py - Main Stylesheet - パフォーマンス最適化版 + 3D可視化対応 */

/* 売買バランス設定パネル */
.sell-buy-ratio-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

.panel-header h3 {
    margin: 0 0 5px 0;
    font-size: 20px;
    font-weight: bold;
}

.panel-subtitle {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 15px;
}

.preset-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.preset-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 100px;
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.preset-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border-color: white;
}

.ratio-controls {
    margin-bottom: 20px;
}

.info-text {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
    margin-top: 15px;
    border-left: 3px solid #ffeb3b;
}

.ratio-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.ratio-row label {
    min-width: 80px;
    font-weight: bold;
}

.ratio-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    -webkit-appearance: none;
}

.ratio-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.ratio-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.ratio-value {
    min-width: 40px;
    font-weight: bold;
    text-align: center;
}

.pain-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.pain-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.pain-item:last-child {
    margin-bottom: 0;
}

.pain-value {
    font-weight: bold;
    color: #ffeb3b;
}

.apply-btn {
    width: 100%;
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* 3D可視化コントロール */
.visualization-controls {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.viz-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.viz-control-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.toggle-3d-btn {
    background: linear-gradient(45deg, #4285f4, #34a853);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

.toggle-3d-btn:hover {
    transform: scale(1.05);
}

.viz-control-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-row label {
    font-weight: 500;
    color: #333;
}

.control-row select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

/* 可視化コンテナ */
.visualization-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.viz-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.viz-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.viz-tab.active {
    background: rgba(66, 133, 244, 0.1);
    border-bottom-color: #4285f4;
    color: #4285f4;
}

.viz-tab:hover:not(.active) {
    background: rgba(0, 0, 0, 0.05);
}

.viz-content {
    padding: 20px;
}

.viz-content.hidden {
    display: none;
}

/* 3Dコンテナ */
.3d-container {
    position: relative;
    width: 100%;
    height: 500px;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    border-radius: 8px;
    overflow: hidden;
}

.3d-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.loading-3d {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #4285f4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

/* 3D情報パネル */
.3d-info-panel {
    margin-top: 15px;
    padding: 15px;
    background: rgba(66, 133, 244, 0.1);
    border-radius: 8px;
}

.3d-legend {
    font-size: 14px;
}

.3d-legend h4 {
    margin: 0 0 10px 0;
    color: #333;
}

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

.legend-color {
    width: 20px;
    height: 12px;
    border-radius: 2px;
}

/* 3Dツールチップスタイル調整 */
#3d-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9) !important;
    color: white !important;
    padding: 10px 12px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    pointer-events: none !important;
    z-index: 10000 !important;
    border: 1px solid rgba(66, 133, 244, 0.5) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nikkei-info {
    flex: 1;
}

.nikkei-price {
    font-size: 28px;
    font-weight: bold;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nikkei-change {
    font-size: 18px;
    margin-left: 10px;
}

.market-data {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    text-align: center;
    font-size: 12px;
}

.market-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 5px;
    backdrop-filter: blur(5px);
}

.market-value {
    font-weight: bold;
    font-size: 14px;
}

.expiry-info {
    text-align: right;
    color: #666;
}

.status {
    margin-bottom: 15px;
    padding: 8px 12px;
    border-radius: 4px;
    background-color: #e8f4fd;
    color: #0066cc;
    font-size: 14px;
}

/* AI予測パネル - アニメーション最適化 */
.ai-prediction-panel {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(30, 60, 114, 0.3);
    position: relative;
    overflow: hidden;
}

.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.ai-title {
    font-size: 20px;
    font-weight: bold;
}

.confidence-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.prediction-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.prediction-main {
    text-align: center;
}

.predicted-price {
    font-size: 36px;
    font-weight: bold;
    margin: 10px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.predicted-change {
    font-size: 18px;
    margin-bottom: 10px;
}

.prediction-details {
    font-size: 14px;
}

.analysis-breakdown {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.analysis-item {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    font-size: 13px;
}

.signal-indicator {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
}

.signal-bullish { background: #4caf50; color: white; }
.signal-bearish { background: #f44336; color: white; }
.signal-neutral { background: #ff9800; color: white; }

/* 市場操作検知アラート */
.manipulation-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    padding: 20px;
    border-radius: 15px;
    color: white;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.manipulation-alert.show {
    transform: translateX(0);
}

.alert-critical {
    background: linear-gradient(135deg, #d32f2f, #f44336);
}

.alert-high {
    background: linear-gradient(135deg, #f57c00, #ff9800);
}

.alert-medium {
    background: linear-gradient(135deg, #fbc02d, #ffeb3b);
    color: #333;
}

.alert-low {
    background: linear-gradient(135deg, #388e3c, #4caf50);
}

.alert-title {
    font-size: 16px;
    margin-bottom: 10px;
}

.alert-details {
    font-size: 14px;
    line-height: 1.4;
}

.filter-container {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-button {
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    backdrop-filter: blur(10px);
}

.filter-button.active {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 5px 15px rgba(255,255,255,0.2);
}

.filter-button:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.chart-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    height: 300px;
    margin-bottom: 20px;
}

.options-table-container {
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

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

.options-table th {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px 8px;
    text-align: center;
    font-weight: 500;
    border: none;
}

.options-table td {
    padding: 12px 8px;
    text-align: right;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.call-header {
    background: linear-gradient(135deg, #4285f4, #1976d2) !important;
}

.put-header {
    background: linear-gradient(135deg, #673ab7, #512da8) !important;
}

.strike-price {
    font-weight: bold;
    text-align: center !important;
    background: linear-gradient(135deg, #f5f5f5, #eeeeee);
    position: relative;
}

.call-section {
    background: rgba(66, 133, 244, 0.03);
}

.put-section {
    background: rgba(103, 58, 183, 0.03);
}

.current-nikkei {
    background: linear-gradient(90deg, rgba(255, 235, 59, 0.3), rgba(255, 235, 59, 0.1)) !important;
    border-left: 4px solid #ffeb3b;
}

.high-oi {
    font-weight: bold;
}

.positive { color: #d50000; font-weight: bold; }
.negative { color: #00c853; font-weight: bold; }

.oi-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    margin-left: 5px;
    font-weight: bold;
}

.call-high-oi {
    background: linear-gradient(45deg, #4285f4, #1976d2);
    color: white;
}

.put-high-oi {
    background: linear-gradient(45deg, #673ab7, #512da8);
    color: white;
}

.recommendation-banner {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    text-align: center;
    margin: 20px 0;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(238, 90, 36, 0.3);
}

.session-indicator {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 1001;
    border: 1px solid rgba(255,255,255,0.2);
    font-weight: bold;
}

@media screen and (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .market-data {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 15px;
    }
    
    .prediction-content {
        grid-template-columns: 1fr;
    }
    
    .manipulation-alert {
        position: relative;
        top: auto;
        right: auto;
        margin: 10px 0;
        transform: none;
        max-width: none;
    }
    
    .manipulation-alert.show {
        transform: none;
    }
}