/* Modern Color Scheme */
:root {
    --primary: #4338ca;
    --primary-light: #6366f1;
    --secondary: #1e40af;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --light: #f9fafb;
    --dark: #1f2937;
    --bg: #f3f4f6;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: var(--dark);
}

.pattern-badge {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    font-size: 0.8em;
    cursor: help;
}
.signal-comment {
    font-size: 0.9em;
    color: #6c757d;
}
/* Sidebar */
.sidebar {
    width: 280px; /* Increased width to prevent scrollbar */
    min-width: 280px; /* Increased to match width */
    background: white;
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    z-index: 100;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.verification-step {
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

#verificationCode {
    font-weight: bold;
    padding: 10px;
}

.btn:focus {
    box-shadow: none !important;
}

/* Smooth transitions for steps */
#verificationSteps > div {
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 16px 20px;
    border-bottom: none;
    font-weight: 600;
    border-radius: 12px 12px 0 0 !important;
}

.btn.disabled, .btn:disabled {
    opacity: 0.65;
    pointer-events: none;
}

/* Signal details styling */
.signal-details {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.signal-details table {
    width: 100%;
}

.signal-details th {
    font-weight: 500;
    color: #6c757d;
    width: 40%;
}

.signal-details td {
    font-weight: 400;
}

/* Make the details row stand out */
tr.collapse.show {
    background-color: rgba(248, 249, 250, 0.5);
}

.spinner-border {
    vertical-align: middle;
}

/* Settings card */
.settings-card {
    height: auto;
    min-height: 220px;
}

/* Symbol sections */
.symbol-section {
    background: #f9fafb;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
}

.symbol-section h6 {
    color: var(--primary) !important;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px !important;
}

.symbol-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 5px 0;
}

/* Form elements */
.form-check {
    margin: 0;
    padding: 8px 10px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s;
}

.form-check:hover {
    background: #f3f4f6;
    border-color: var(--primary-light);
}

.form-check-label {
    font-family: 'Space Mono', monospace;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85rem;
    margin-left: 8px;
}

.form-switch .form-check-input {
    width: 2.5em;
    background-color: var(--light);
    margin-left: 0;
}

.form-switch .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-switch .form-check-label {
    font-weight: 600;
    color: var(--dark);
}

.form-select, .form-control {
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 10px;
    transition: all 0.3s;
}

.form-select:focus, .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}

.btn-light {
    background: white;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-light:hover {
    background: #f3f4f6;
}

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

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
}

/* Tables */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 1rem;
    width: 100%;
}

.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin-bottom: 0; /* Prevents extra space */
}

.table th {
    background-color: #f9fafb;
    color: var(--text);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table td {
    padding: 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    white-space: nowrap;
}

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

/* Remove horizontal scrollbar in signal container */
#signalContainer .table-responsive {
    overflow-x: hidden; /* Changed from auto to hidden */
    max-height: none;
}

#signalContainer table {
    width: 100%;
    table-layout: auto; /* Changed from fixed to auto for better content accommodation */
}

/* Progress bars */
.progress {
    height: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Current plan card */
.current-plan-card {
    background: rgba(255, 255, 255, 0.9);
    color: #1c3940;
    border: 1px solid rgba(28, 57, 64, 0.12);
    box-shadow: 0 20px 45px rgba(17, 37, 41, 0.18);
    border-radius: 18px;
}

.current-plan-card .card-body {
    padding: 1.75rem;
}

/* Badges */
.badge {
    padding: 6px 10px;
    font-weight: 500;
    border-radius: 6px;
    font-size: 0.75rem;
}

code {
    font-family: monospace;
    background: #f8f9fa;
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid #dee2e6;
}

/* Responsive table */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.badge.bg-success {
    background-color: var(--success) !important;
}

.badge.bg-danger {
    background-color: var(--danger) !important;
}

.badge.bg-info {
    background-color: var(--info) !important;
}

.badge.bg-warning {
    background-color: var(--warning) !important;
}
.bg-danger {
    background-color: #dc3545 !important;
}
.bg-secondary {
    background-color: #6c757d !important;
}
.text-success {
    color: #28a745 !important;
}
.text-danger {
    color: #dc3545 !important;
}
.pattern-badge {
    font-size: 0.75rem;
    white-space: nowrap;
    background-color: #dbeafe !important;
    color: #1e40af;
}

/* Search input styling */
.signal-search {
    max-width: 250px;
    transition: all 0.3s;
    border-radius: 20px;
    padding-left: 35px;
}

.spinner-border {
    vertical-align: middle;
    margin-right: 5px;
}

.signal-search:focus {
    max-width: 300px;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-wrapper {
    position: relative;
}

.search-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Plan cards */
.plan-card {
    transition: all 0.3s ease;
    transform: scale(1);
}

.plan-card.featured {
    transform: scale(1.05);
    border: 2px solid var(--primary) !important;
}

.plan-card:hover {
    transform: translateY(-10px);
}

.plan-card .card-header {
    text-align: center;
    padding: 20px;
}

.plan-card .card-body {
    padding: 30px 20px;
}

.plan-card .pricing {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.plan-card .feature-list {
    margin-top: 20px;
}

.plan-card .feature-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
}

.plan-card .feature-icon {
    color: var(--success);
    margin-right: 10px;
}

/* Animation for spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* Scrollbar styling */
#symbolList, .table-responsive {
    scrollbar-width: thin;
}

#symbolList::-webkit-scrollbar, .table-responsive::-webkit-scrollbar {
    width: 5px;
}

#symbolList::-webkit-scrollbar-track, .table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#symbolList::-webkit-scrollbar-thumb, .table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

#symbolList::-webkit-scrollbar-thumb:hover, .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Main content */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-x: hidden;
}

/* Alignment for the dashboard layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Signal card transition */
.signal-card {
    transition: transform 0.2s;
}

.signal-card:hover {
    transform: translateY(-5px);
}

/* Signal view button metrics */
.signal-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.2;
    white-space: normal;
    flex-wrap: wrap;
}

.signal-view-btn .btn-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
}

.signal-view-btn .btn-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.signal-view-btn .metric-badge {
    background: rgba(17, 125, 138, 0.12);
    color: #0b5a6d;
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
    font-weight: 600;
}

.signal-view-btn .metric-badge.risk {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

/* Last updated indicator */
#lastUpdated {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 10px;
    white-space: nowrap;
}

/* Expandable sidebar */
.sidebar-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    z-index: 101;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.dropdown-menu.filter-dropdown {
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.filter-dropdown .dropdown-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    padding: 0 0 8px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.filter-dropdown .form-label {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--text-muted);
}

.filter-dropdown .form-select {
    font-size: 0.8rem;
    padding: 5px 10px;
}

.filter-dropdown .btn-group {
    width: 100%;
}

.filter-dropdown .btn {
    font-size: 0.8rem;
    padding: 5px 10px;
}
/* Expandable navbar */
.nav-expander {
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-expander:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .sidebar {
        width: 260px;
        min-width: 260px;
    }
}

@media (max-width: 767.98px) {
    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        position: relative;
    }
    
    .table-responsive {
        max-height: 400px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .signal-table {
        min-width: 650px;
    }

    .plan-card.featured {
        transform: scale(1);
    }
    
    .table td, .table th {
        padding: 8px;
        font-size: 0.8rem;
    }
}

@media (max-width: 575.98px) {
    .signal-table {
        min-width: 0;
    }

    .signal-table thead {
        display: none;
    }

    .signal-table tbody tr:not([data-detail-row]) {
        display: block;
        padding: 0.85rem 1rem;
        margin-bottom: 0.85rem;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 14px;
        box-shadow: 0 10px 24px rgba(17, 37, 41, 0.18);
        border: 1px solid rgba(28, 57, 64, 0.08);
    }

    .signal-table tbody tr:not([data-detail-row]) td {
        display: block;
        padding: 0.4rem 0;
        font-size: 0.9rem;
        border-bottom: 1px solid rgba(28, 57, 64, 0.08);
    }

    .signal-table tbody tr:not([data-detail-row]) td:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-top: 0.4rem;
        text-align: right;
    }

    .signal-table tbody tr:not([data-detail-row]) td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        color: #6c757d;
        letter-spacing: 0.04em;
        margin-bottom: 0.2rem;
    }

    .signal-table tbody tr:not([data-detail-row]) td:last-child button {
        width: 100%;
        white-space: normal;
        font-size: 0.95rem;
    }

    .signal-table tbody tr:not([data-detail-row]) td:last-child .signal-view-btn {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .signal-table tbody tr:not([data-detail-row]) td:last-child .signal-view-btn .btn-meta {
        width: 100%;
        justify-content: flex-start;
    }

    .signal-table .progress {
        height: 18px;
    }
}
.plan-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(28, 57, 64, 0.12);
    color: #1c3940;
}

.plan-card.featured {
    background: rgba(63, 139, 153, 0.12);
    border: 2px solid rgba(63, 139, 153, 0.5) !important;
}

.plan-card .card-body {
    background: transparent;
}
