/* Bitcoin RL Trading Bot - Custom Styles */

/* ダッシュボードカード */
.stat-card {
    background-color: rgb(31 41 55); /* bg-gray-800 */
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid rgb(55 65 81); /* border-gray-700 */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* テーブル */
.data-table {
    width: 100%;
    font-size: 0.875rem;
    text-align: left;
}
.data-table thead th {
    padding: 0.75rem 1rem;
    background-color: rgb(31 41 55);
    color: rgb(156 163 175); /* text-gray-400 */
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgb(55 65 81);
}
.data-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgb(31 41 55);
}
.data-table tbody tr:hover {
    background-color: rgba(31, 41, 55, 0.5);
}

/* タブナビゲーション */
.tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: color 0.15s, background-color 0.15s;
}
.tab-btn.active {
    background-color: rgb(37 99 235); /* bg-blue-600 */
    color: white;
}
.tab-btn:not(.active) {
    color: rgb(156 163 175);
}
.tab-btn:not(.active):hover {
    color: white;
    background-color: rgb(55 65 81);
}

/* 設定フォーム */
.config-section {
    background-color: rgb(31 41 55);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid rgb(55 65 81);
    margin-bottom: 1rem;
}
.config-field {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}
.config-field:last-child {
    border-bottom: none;
}
.config-input {
    background-color: rgb(55 65 81);
    border: 1px solid rgb(75 85 99); /* border-gray-600 */
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    color: white;
    font-size: 0.875rem;
    width: 8rem;
    text-align: right;
}
.config-input:focus {
    border-color: rgb(59 130 246); /* border-blue-500 */
    box-shadow: 0 0 0 1px rgb(59 130 246);
    outline: none;
}

/* トグルスイッチ */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 1.5rem;
    width: 2.75rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.15s;
}
.toggle-switch.on {
    background-color: rgb(37 99 235);
}
.toggle-switch.off {
    background-color: rgb(75 85 99);
}
.toggle-knob {
    position: absolute;
    height: 1.25rem;
    width: 1.25rem;
    border-radius: 9999px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: transform 0.15s;
}
.toggle-switch.on .toggle-knob {
    transform: translateX(22px);
}
.toggle-switch.off .toggle-knob {
    transform: translateX(2px);
}

/* バッジ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-green {
    background-color: rgba(20, 83, 45, 0.5);
    color: rgb(74 222 128); /* text-green-400 */
    border: 1px solid rgba(21, 128, 61, 0.5);
}
.badge-red {
    background-color: rgba(127, 29, 29, 0.5);
    color: rgb(248 113 113); /* text-red-400 */
    border: 1px solid rgba(185, 28, 28, 0.5);
}
.badge-yellow {
    background-color: rgba(113, 63, 18, 0.5);
    color: rgb(250 204 21); /* text-yellow-400 */
    border: 1px solid rgba(161, 98, 7, 0.5);
}
.badge-blue {
    background-color: rgba(30, 58, 138, 0.5);
    color: rgb(96 165 250); /* text-blue-400 */
    border: 1px solid rgba(29, 78, 216, 0.5);
}
.badge-gray {
    background-color: rgba(55, 65, 81, 0.5);
    color: rgb(156 163 175);
    border: 1px solid rgba(75, 85, 99, 0.5);
}

/* チャートコンテナ */
.chart-container {
    background-color: rgb(31 41 55);
    border-radius: 0.75rem;
    padding: 1rem;
    border: 1px solid rgb(55 65 81);
    position: relative;
    height: 350px;
}

/* ローディング */
.loading-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgb(156 163 175);
    border-top-color: rgb(59 130 246);
    border-radius: 9999px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* スクロールバー */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background-color: rgb(17 24 39); /* bg-gray-900 */
}
::-webkit-scrollbar-thumb {
    background-color: rgb(55 65 81);
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background-color: rgb(75 85 99);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .chart-container {
        height: 250px;
    }
    #priceChartContainer {
        height: 250px !important;
    }
    #portfolioChartContainer {
        height: 100px !important;
    }
}

/* チャートコンテナ内のLWCキャンバス */
#priceChartContainer,
#portfolioChartContainer {
    width: 100%;
}

/* トースト通知 */
.toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px rgba(0,0,0,0.3);
    font-size: 0.875rem;
    z-index: 50;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* モデルカード */
.model-card {
    background-color: rgb(31 41 55);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid rgb(55 65 81);
    transition: border-color 0.15s;
}
.model-card:hover {
    border-color: rgb(107 114 128); /* border-gray-500 */
}

/* PnLカラー */
.pnl-positive { color: rgb(74 222 128); }
.pnl-negative { color: rgb(248 113 113); }
.pnl-zero { color: rgb(156 163 175); }
