/* TradeEntry Page Enhanced Styles - ULTRA COMPACT VERSION */

.trade-form-section {
    background: #f8f9fa;
    border-left: 2px solid #0d6efd; /* Even thinner */
    padding: 0.4rem 0.5rem; /* Very compact */
    margin-bottom: 0.5rem; /* Minimal margin */
    border-radius: 0.25rem;
}

.trade-form-section-header {
    font-size: 0.75rem; /* Very small */
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.4rem; /* Minimal */
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.trade-form-section-header i {
    color: #0d6efd;
    font-size: 0.85rem;
}

/* ULTRA Compact Form Controls */
.trade-form-section .form-label {
    margin-bottom: 0.15rem; /* Minimal */
    font-size: 0.75rem; /* Smaller */
    font-weight: 500;
}

.trade-form-section .form-control,
.trade-form-section .form-select {
    padding: 0.25rem 0.4rem; /* Ultra compact */
    font-size: 0.8125rem;
    height: calc(1.5em + 0.5rem + 2px); /* Very compact height */
}

.trade-form-section input[type="number"],
.trade-form-section input[type="date"],
.trade-form-section input[type="text"],
.trade-form-section textarea {
    padding: 0.25rem 0.4rem;
}

.trade-form-section textarea {
    padding: 0.4rem;
}

.trade-form-section .form-control-sm {
    padding: 0.2rem 0.3rem;
    font-size: 0.75rem;
}

.trade-form-section .form-text {
    font-size: 0.7rem;
    margin-top: 0.1rem;
    line-height: 1.2;
}

/* Entry zone indicator (S1 <-> R1) */
.sa-zonebar {
    margin-top: 0.2rem;
}

.sa-zonebar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: #6c757d;
    line-height: 1;
    margin-bottom: 0.15rem;
}

.sa-zonebar-track {
    position: relative;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    display: flex;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
}

.sa-zonebar-seg {
    height: 100%;
}

.sa-zonebar-middle {
    background: #e9ecef;
}

.sa-zonebar-demand {
    background: rgba(25, 135, 84, 0.55);
}

.sa-zonebar-supply {
    background: rgba(220, 53, 69, 0.55);
}

/* Safe vs Avoid zones (independent of Long/Short) */
.sa-zonebar-good {
    background: rgba(25, 135, 84, 0.55);
}

.sa-zonebar-bad {
    background: rgba(220, 53, 69, 0.55);
}

.sa-zonebar-marker {
    position: absolute;
    top: -3px;
    width: 3px;
    height: 14px;
    background: #ffc107;
    border-radius: 2px;
    transform: translateX(-50%);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}

.trade-form-section .form-check {
    margin-bottom: 0;
}

.trade-form-section .form-check-label {
    font-size: 0.75rem;
}

/* Risk Indicator Styles */
.risk-indicator {
    padding: 0.4rem;
    border-radius: 0.25rem;
    border: 1px solid;
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
}

.risk-low {
    border-color: #198754;
    background-color: rgba(25, 135, 84, 0.1);
}

.risk-medium {
    border-color: #ffc107;
    background-color: rgba(255, 193, 7, 0.1);
}

.risk-high {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(220, 53, 69, 0); }
}

/* Enhanced Status Badges - Ultra Compact */
.status-badge-planned,
.status-badge-ordered,
.status-badge-entered,
.status-badge-partial,
.status-badge-exited,
.status-badge-cancelled {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.status-badge-planned {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.status-badge-ordered {
    background: linear-gradient(135deg, #0dcaf0 0%, #0aa2c0 100%);
}

.status-badge-entered {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

.status-badge-exited {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
}

.status-badge-cancelled {
    background: linear-gradient(135deg, #dc3545 0%, #bb2d3b 100%);
}

/* Risk/Reward Display - Ultra Compact */
.rr-display {
    background: white;
    border-radius: 0.25rem;
    padding: 0.4rem; /* Very compact */
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e9ecef;
}

.rr-item {
    text-align: center;
}

.rr-label {
    font-size: 0.65rem; /* Very small */
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    margin-bottom: 0.1rem;
    line-height: 1.1;
}

.rr-value {
    font-size: 0.95rem; /* Smaller */
    font-weight: 600;
    line-height: 1.1;
}

.rr-value.positive {
    color: #198754;
}

.rr-value.negative {
    color: #dc3545;
}

.rr-value small {
    font-size: 0.7rem;
}

/* Enhanced Buttons - Ultra Compact */
.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-icon i {
    font-size: 0.85rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Card Enhancements */
.card.sa-form, .card.sa-grid {
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid #e3e6ea;
}

.card-header {
    background: linear-gradient(to right, #f8f9fa, #ffffff);
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.4rem 0.6rem; /* Ultra compact header */
}

/* Table Enhancements - Compact */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
    transition: background-color 0.15s ease;
}

.table thead th {
    font-size: 0.7rem;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    padding: 0.3rem 0.4rem;
}

.table tbody td {
    font-size: 0.75rem;
    padding: 0.3rem 0.4rem;
}

/* Exit Mode Panel - Compact */
.exit-mode-panel {
    background: linear-gradient(135deg, #fff3cd 0%, #fffbeb 100%);
    border: 2px solid #ffc107;
    border-radius: 0.25rem;
    padding: 0.6rem;
    margin-top: 0.5rem;
}

.exit-mode-panel h6 {
    font-size: 0.875rem;
    margin-bottom: 0;
}

.exit-mode-panel .form-label {
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
}

/* Modal Enhancements */
.modal-content {
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.modal-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: white;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 0.6rem 0.8rem;
}

.modal-header .modal-title {
    font-size: 0.9375rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 0.6rem 0.8rem;
    font-size: 0.8125rem;
}

/* Input Focus Enhancements */
.form-control:focus, .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.1);
}

/* Score Badge Enhancement */
.score-badge {
    font-size: 0.8125rem;
    padding: 0.3rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Action Buttons Container - Ultra Compact */
.action-buttons {
    display: flex;
    gap: 0.15rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    font-size: 0.65rem;
    padding: 0.2rem 0.35rem;
}

/* Demo/Real Badges - Ultra Compact */
.demo-badge,
.real-badge {
    padding: 0.15rem 0.35rem;
    border-radius: 0.2rem;
    font-size: 0.65rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.demo-badge {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.demo-badge i {
    font-size: 0.75rem;
}

.real-badge {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
    color: white;
}

.real-badge i {
    font-size: 0.75rem;
}

/* Long/Short Indicators */
.side-long {
    color: #198754 !important;
    font-weight: 600;
}

.side-short {
    color: #dc3545 !important;
    font-weight: 600;
}

/* ULTRA Compact spacing for rows */
.sa-form .row {
    --bs-gutter-y: 0.4rem !important; /* Minimal gap */
    --bs-gutter-x: 0.5rem !important;
}

/* ULTRA Compact column spacing */
.sa-form .col-md-1,
.sa-form .col-md-2,
.sa-form .col-md-3,
.sa-form .col-md-4,
.sa-form .col-md-12 {
    padding-left: 0.3rem !important;
    padding-right: 0.3rem !important;
}

/* Reduce all margins in form */
.sa-form h6,
.sa-form .fw-semibold {
    margin-bottom: 0.2rem;
}

.sa-form .mb-3 {
    margin-bottom: 0.5rem !important;
}

.sa-form .mt-2 {
    margin-top: 0.3rem !important;
}

.sa-form .ms-2 {
    margin-left: 0.3rem !important;
}

.sa-form .gap-2 {
    gap: 0.3rem !important;
}

@media (max-width: 767.98px) {
    .sa-split {
        display: block !important;
    }

    .sa-form {
        width: 100%;
        margin-bottom: 0;
    }

    .trade-form-section-header {
        font-size: 0.95rem;
    }

    .card-header .btn {
        white-space: nowrap;
    }
}

