/**
 * Options Basket Order System - Styles
 */

/* ==================== LAYOUT ==================== */

body {
    background-color: #f5f5f5;
}

.price-bar {
    border-bottom: 2px solid #28a745;
}

/* ==================== EXPIRY BUTTONS ==================== */

.expiry-btn {
    min-width: 100px;
    font-weight: 500;
    transition: all 0.2s;
}

.expiry-btn.active {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* ==================== OPTION CHAIN TABLE ==================== */

.option-chain-table {
    font-size: 0.9rem;
}

.option-chain-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
}

.option-chain-table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.1) !important;
}

.strike-cell {
    background-color: #e9ecef;
    font-size: 1rem;
}

.ltp-value {
    font-family: 'Roboto Mono', monospace;
    font-weight: 500;
}

.add-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.add-btn:hover {
    transform: scale(1.2);
}

/* ATM row highlighting */
.table-warning .strike-cell {
    background-color: #ffc107;
    color: #000;
}

/* ==================== BASKET ==================== */

#basketContainer {
    max-height: 300px;
    overflow-y: auto;
}

#basketTable {
    font-size: 0.85rem;
}

#basketTable .badge {
    font-size: 0.7rem;
}

/* ==================== EXECUTION LOG ==================== */

.execution-log {
    max-height: 200px;
    overflow-y: auto;
    background-color: #0b1220; /* darker background for contrast */
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: #e6eef6; /* default text color */
    padding: 8px;
    border-radius: 4px;
}

.log-entry {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: inherit; /* use execution-log color by default */
}

.log-success {
    color: #7CFCB2; /* brighter green */
    font-weight: 600;
}

.log-error {
    color: #FF6B6B; /* brighter red */
    font-weight: 600;
}

.log-info {
    color: #66d9ff; /* brighter info color */
    font-weight: 600;
}

/* ==================== MODAL STYLES ==================== */

.qty-btn.active {
    background-color: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
}

#accountCheckboxes {
    max-height: 150px;
    overflow-y: auto;
}

/* ==================== CARDS ==================== */

.card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: none;
}

.card-header {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 992px) {
    .option-chain-table {
        font-size: 0.8rem;
    }
    
    .expiry-btn {
        min-width: 80px;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .add-btn {
        width: 24px;
        height: 24px;
    }
    
    .strike-cell {
        font-size: 0.85rem;
    }
}

/* ==================== ANIMATIONS ==================== */

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.executing {
    animation: pulse 1s infinite;
}

/* ==================== SCROLLBAR ==================== */

#optionChainContainer {
    max-height: 500px;
    overflow-y: auto;
}

#optionChainContainer::-webkit-scrollbar,
.execution-log::-webkit-scrollbar,
#basketContainer::-webkit-scrollbar {
    width: 8px;
}

#optionChainContainer::-webkit-scrollbar-track,
.execution-log::-webkit-scrollbar-track,
#basketContainer::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#optionChainContainer::-webkit-scrollbar-thumb,
.execution-log::-webkit-scrollbar-thumb,
#basketContainer::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#optionChainContainer::-webkit-scrollbar-thumb:hover,
.execution-log::-webkit-scrollbar-thumb:hover,
#basketContainer::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ==================== FUTURES ORDER SECTION ==================== */

.futures-order-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.badge-info {
    background-color: #17a2b8 !important;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-primary {
    background-color: #007bff !important;
}

/* Basket Item Styling */
.basket-item {
    transition: all 0.2s ease;
    background: white;
}

.basket-item:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.basket-item .badge {
    margin-right: 5px;
    font-size: 0.7rem;
}

/* Futures Account Checkboxes */
#futuresAccountsCheckboxes .form-check {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: background-color 0.2s ease;
    border: 1px solid transparent;
}

#futuresAccountsCheckboxes .form-check:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

#futuresAccountsCheckboxes .form-check-input:disabled ~ .form-check-label {
    opacity: 0.5;
    cursor: not-allowed;
}

#futuresAccountsCheckboxes .form-check-label {
    width: 100%;
    cursor: pointer;
    margin-bottom: 0;
}

/* Order Summary Preview */
#futuresOrderSummary {
    border-left: 4px solid #17a2b8;
    background: #f8f9fa;
}

/* Quick Actions */
.card-header.bg-secondary {
    background-color: #6c757d !important;
}

/* Input Group Buttons */
.input-group .btn-outline-secondary {
    border-color: #dee2e6;
}

.input-group .btn-outline-secondary:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* Current Price Display */
#futuresCurrentPrice {
    color: #17a2b8;
    font-family: 'Courier New', monospace;
}

/* Form Labels with Icons */
.form-label i {
    margin-right: 5px;
    color: #6c757d;
}

/* Contract Quick Buttons */
.btn-outline-primary.btn-sm {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* Execution Log Styling */
.log-entry {
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 4px;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.log-info {
    background-color: #e7f3ff;
    border-left-color: #0066cc;
}

.log-success {
    background-color: #d4edda;
    border-left-color: #28a745;
}

.log-error {
    background-color: #f8d7da;
    border-left-color: #dc3545;
}

.log-warning {
    background-color: #fff3cd;
    border-left-color: #ffc107;
}

/* Empty Basket */
.empty-basket {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
}
