/* Custom styles for TSLA Spreads Analyzer */

/* Ensure consistent spacing */
.container {
    max-width: 1400px;
}

/* Card enhancements */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
}

.card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem;
}

/* Table enhancements */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    padding: 1rem 0.75rem;
}

.table td {
    padding: 0.75rem;
    vertical-align: middle;
}

.table-responsive {
    border-radius: 0.375rem;
}

/* Progress bar styling */
.progress {
    background-color: rgba(255, 255, 255, 0.1);
}

.progress-bar {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 20px;
}

/* Badge enhancements */
.badge {
    font-size: 0.75em;
    padding: 0.35em 0.65em;
}

/* Chart container */
#chartContainer {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.375rem;
    padding: 1.5rem;
}

/* Loading spinner */
#loadingSpinner {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Summary cards */
#resultsSummary .card {
    border: none;
    margin-bottom: 0;
}

#resultsSummary .card-body {
    padding: 1.5rem 1rem;
}

#resultsSummary h5 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

#resultsSummary h3,
#resultsSummary h4,
#resultsSummary h6 {
    margin-bottom: 0;
    font-weight: 700;
}

/* Filter controls */
#filterControls {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
    
    #resultsSummary .col-md-3 {
        margin-bottom: 1rem;
    }
    
    #filterControls .col-md-3 {
        margin-bottom: 0.5rem;
    }
}

/* Navigation enhancements */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
}

/* Footer */
footer {
    margin-top: auto;
    background: rgba(0, 0, 0, 0.2) !important;
}

/* Form enhancements */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--bs-body-color);
}

.form-control:focus,
.form-select:focus {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
    color: var(--bs-body-color);
}

/* Fix dropdown option visibility */
.form-select option {
    background-color: var(--bs-gray-800);
    color: var(--bs-body-color);
}

/* Ensure text is visible in all states */
select.form-select,
select.form-select option {
    color: var(--bs-body-color) !important;
}

/* Button enhancements */
.btn {
    font-weight: 600;
    padding: 0.5rem 1rem;
}

.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.btn-primary:hover {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    opacity: 0.9;
}

/* Alert enhancements */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Modal enhancements */
.modal-content {
    background-color: var(--bs-gray-900);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Toast notifications */
.toast {
    background-color: var(--bs-gray-800);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-header {
    background-color: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Utility classes */
.text-success {
    color: var(--bs-success) !important;
}

.text-danger {
    color: var(--bs-danger) !important;
}

.text-warning {
    color: var(--bs-warning) !important;
}

.text-info {
    color: var(--bs-info) !important;
}

/* Animation for table rows */
.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Highlight top performing spreads */
.table-success {
    background-color: rgba(var(--bs-success-rgb), 0.1) !important;
}

/* Sortable table headers */
.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.sortable:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.sortable i {
    margin-left: 0.5rem;
    font-size: 0.8rem;
}

.sortable.sort-asc i:before {
    content: "\f0de"; /* fa-sort-up */
    color: var(--bs-primary) !important;
}

.sortable.sort-desc i:before {
    content: "\f0dd"; /* fa-sort-down */
    color: var(--bs-primary) !important;
}

/* Clickable table rows */
.clickable-row {
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.clickable-row:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.clickable-row:active {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

/* ================================
   MOBILE-SPECIFIC STYLES
   ================================ */

/* Mobile tablets and below (768px and down) */
@media (max-width: 768px) {
    /* Manual Calculator Mobile Layout Fixes */
    
    /* Remove fixed height constraints that prevent scrolling */
    .row[style*="height: 100vh"] {
        height: auto !important;
        overflow: visible !important;
    }
    
    /* Allow natural scrolling in analysis results */
    .card-body[style*="height: calc(100vh - 200px)"] {
        height: auto !important;
        overflow-y: visible !important;
        max-height: none !important;
    }
    
    /* Make cards stack vertically with proper spacing */
    .col-lg-4 {
        margin-bottom: 1rem;
    }
    
    /* Remove h-100 constraint on mobile for natural content flow */
    .card.h-100 {
        height: auto !important;
    }
    
    /* Ensure content is not cut off */
    .card-body {
        overflow-y: visible !important;
    }
}

/* Mobile phones only (576px and down) */
@media (max-width: 576px) {
    /* Additional mobile phone specific adjustments */
    
    /* Reduce card margins for better space usage */
    .card {
        margin-bottom: 1rem;
    }
    
    /* Make form elements more touch-friendly */
    .form-control, .form-select {
        padding: 0.75rem 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Better button sizing for touch */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}
