/* Orders Tab Custom Styling */

/* Loading spinner animation */
#orders-wrapper .spinner-border {
    border-width: 0.25em;
}

/* Table row hover effect */
#orders-wrapper .table tbody tr {
    transition: background-color 0.15s ease;
}

#orders-wrapper .table tbody tr:hover {
    background-color: rgba(36, 100, 235, 0.04);
    cursor: pointer;
}

/* Badge styling */
#orders-wrapper .badge {
    font-weight: 600;
    padding: 0.35em 0.65em;
    font-size: 0.8em;
}

/* Empty state styling */
#orders-wrapper .fa-inbox {
    opacity: 0.3;
}

/* Modal styling for better visibility */
#orders-details-modal pre {
    max-height: 200px;
    overflow-y: auto;
}

/* Profit/Loss color coding */
#orders-wrapper .text-success {
    color: #22c55e !important;
    font-weight: 600;
}

#orders-wrapper .text-danger {
    color: #ef4444 !important;
    font-weight: 600;
}

/* Loading placeholder shimmer effect (if not in common.css) */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Statistics card hover effect */
#orders-wrapper .card:first-child:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #orders-wrapper .table {
        font-size: 0.85rem;
    }

    #orders-wrapper .card-body .col-md-4 {
        margin-bottom: 1rem;
    }
}

/* Button running state */
#orders-wrapper .btn.running {
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* ===== Order Details Modal ===== */
.od-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1050;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.od-modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    max-width: 780px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
}

.od-header {
    padding: 18px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 14px 14px 0 0;
}

.od-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.od-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

.od-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #475569;
}

.od-body {
    padding: 24px;
}

.od-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    margin-bottom: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.od-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: #fff;
}

.od-field.od-full {
    grid-column: 1 / -1;
}

.od-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #94a3b8;
}

.od-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
}

.od-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.od-code-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.od-code-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.od-code {
    margin: 0;
    padding: 12px 16px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.82rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    white-space: pre-wrap;
    word-break: break-word;
    color: #334155;
}

.od-footer {
    padding: 14px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 0 0 14px 14px;
}

.od-close-btn {
    padding: 8px 24px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.od-close-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* Dark mode */
.dark-mode .od-overlay {
    background: rgba(0, 0, 0, 0.75);
}

.dark-mode .od-modal {
    background: #161b22;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.dark-mode .od-header {
    background: linear-gradient(135deg, #1c2333, #161b22);
    border-bottom-color: #30363d;
}

.dark-mode .od-header h5 {
    color: #e6edf3;
}

.dark-mode .od-close {
    color: #484f58;
}

.dark-mode .od-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #c9d1d9;
}

.dark-mode .od-grid {
    background: #30363d;
}

.dark-mode .od-field {
    background: #161b22;
}

.dark-mode .od-label {
    color: #484f58;
}

.dark-mode .od-value {
    color: #e6edf3;
}

.dark-mode .od-code {
    background: #0d1117;
    border-color: #30363d;
    color: #c9d1d9;
}

.dark-mode .od-footer {
    background: linear-gradient(135deg, #1c2333, #161b22);
    border-top-color: #30363d;
}

.dark-mode .od-close-btn {
    background: #21262d;
    border-color: #30363d;
    color: #c9d1d9;
}

.dark-mode .od-close-btn:hover {
    background: #30363d;
    border-color: #484f58;
}

@media (max-width: 640px) {
    .od-grid {
        grid-template-columns: 1fr;
    }
    .od-body {
        padding: 16px;
    }
}