/* EP1PHNY Dashboard Styles - Light Theme (Bootstrap Dashboard Style) */

:root {
    --sidebar-width: 240px;
    --primary-color: #475569;
    --primary-light: #64748b;
    --success-color: #22c55e;
    --gradient-dark: #1e293b;
    --gradient-light: #64748b;
}

/* Body */
body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.875rem;
    background-color: #f8f9fa;
    color: #212529;
    overflow-x: hidden;
}

/* Auth screens background */
.auth-screen {
    background: linear-gradient(135deg, var(--gradient-dark) 0%, var(--gradient-light) 100%);
    min-height: 100vh;
}

/* Auth card styling */
.auth-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-width: 480px;
    width: 100%;
    padding: 40px;
}

/* Step indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
}

.step-indicator .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-indicator .step-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.step-indicator .step-circle.inactive {
    background: #e5e7eb;
    color: #9ca3af;
}

.step-indicator .step-circle.active {
    background: var(--primary-color);
    color: white;
}

.step-indicator .step-circle.completed {
    background: var(--success-color);
    color: white;
}

.step-indicator .step-label {
    margin-top: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
}

.step-indicator .step-label.active {
    color: var(--primary-color);
}

.step-indicator .step-line {
    width: 80px;
    height: 2px;
    background: #e5e7eb;
    margin: 0 8px;
    margin-bottom: 24px;
}

.step-indicator .step-line.completed {
    background: var(--success-color);
}

/* Auth form buttons */
.btn-primary-auth {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary-auth:hover {
    background: var(--primary-light);
    color: white;
    transform: translateY(-1px);
}

.btn-success-auth {
    background: var(--success-color);
    border: none;
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-success-auth:hover {
    background: #16a34a;
    color: white;
    transform: translateY(-1px);
}

.btn-outline-auth {
    background: white;
    border: 1.5px solid #e5e7eb;
    color: #374151;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 500;
}

.btn-outline-auth:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Auth info box */
.info-box {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0fdfa 100%);
    border: 1px solid #a5f3fc;
    border-radius: 12px;
    padding: 16px;
    font-size: 0.9rem;
}

/* Auth form inputs */
.auth-input {
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.auth-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(91, 95, 199, 0.15);
}

.auth-input.highlight {
    background: #fef9c3;
    border-color: #fde047;
}

/* All buttons should not wrap text */
.btn {
    white-space: nowrap;
}

/* Top Navbar */
.navbar-brand {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    background-color: rgba(0, 0, 0, 0.25);
}

.navbar .form-control {
    padding: 0.5rem 1rem;
    border-radius: 0;
    border: none;
}

.form-control-dark {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: transparent;
}

.form-control-dark:focus {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
    color: #fff;
}

.form-control-dark::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 56px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.1);
    width: var(--sidebar-width);
}

@media (max-width: 767.98px) {
    .sidebar {
        width: 100%;
    }
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 0.5rem 1rem;
    transition: all 0.15s ease-in-out;
}

.sidebar .nav-link:hover {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.05);
}

.sidebar .nav-link.active {
    color: #007bff;
    border-left: 3px solid #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.sidebar .nav-link i {
    margin-right: 4px;
    color: #999;
}

.sidebar .nav-link.active i,
.sidebar .nav-link:hover i {
    color: inherit;
}

.sidebar-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Main content */
main {
    min-width: 0;
    /* Prevent content overflow */
}

/* TOTP Input - 6 individual boxes (horizontal layout) */
.totp-inputs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.totp-inputs input {
    width: 52px !important;
    height: 60px !important;
    min-width: 52px;
    flex: 0 0 52px;
    text-align: center;
    font-size: 1.75rem;
    font-weight: 500;
    color: #333;
    border: 1.5px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.totp-inputs input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    outline: none;
}

.totp-inputs input::placeholder {
    color: #d1d5db;
}

.totp-inputs input::-webkit-outer-spin-button,
.totp-inputs input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.totp-inputs input[type="number"] {
    -moz-appearance: textfield;
}

/* Cards with colored left border */
.border-left-primary {
    border-left: 4px solid #4e73df !important;
}

.border-left-success {
    border-left: 4px solid #1cc88a !important;
}

.border-left-info {
    border-left: 4px solid #36b9cc !important;
}

.border-left-warning {
    border-left: 4px solid #f6c23e !important;
}

.border-left-danger {
    border-left: 4px solid #e74a3b !important;
}

/* Card styling */
.card {
    border: none;
    border-radius: 0.35rem;
}

.card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
}

/* Text utilities */
.text-xs {
    font-size: 0.7rem;
}

.font-weight-bold {
    font-weight: 700 !important;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

/* Kill Switch Button */
#kill-switch {
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

#kill-switch:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

#kill-switch.engaged {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Progress bars */
.progress {
    height: 0.75rem;
    border-radius: 0.25rem;
}

/* Tables */
.table thead th {
    border-bottom: 2px solid #e3e6f0;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #858796;
}

/* View transitions */
.view {
    animation: fadeIn 0.15s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Fade out animation for progress panel */
.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f8f9fa;
}

::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Card icon sizing */
.card-body .bi.fs-1 {
    font-size: 2rem !important;
    opacity: 0.3;
}

/* ==================== Resizable Split-View Layout ==================== */

.split-view-container {
    display: flex;
    height: calc(100vh - 56px);
    /* Full height minus navbar */
    margin-top: 56px;
    /* Account for fixed navbar */
    overflow: hidden;
}

/* Sidebar Panel */
.sidebar-panel {
    width: 20%;
    /* Default 20% width */
    min-width: 180px;
    max-width: 400px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.sidebar-panel .nav-link {
    font-weight: 500;
    color: #333;
    padding: 0.5rem 1rem;
    transition: all 0.15s ease-in-out;
}

.sidebar-panel .nav-link:hover {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.05);
}

.sidebar-panel .nav-link.active {
    color: #007bff;
    border-left: 3px solid #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.sidebar-panel .nav-link i {
    margin-right: 4px;
    color: #999;
}

.sidebar-panel .nav-link.active i,
.sidebar-panel .nav-link:hover i {
    color: inherit;
}

/* Resize Handle */
.resize-handle {
    width: 6px;
    background: linear-gradient(90deg, #e5e7eb 0%, #d1d5db 50%, #e5e7eb 100%);
    cursor: col-resize;
    flex-shrink: 0;
    transition: background 0.15s ease;
    position: relative;
}

.resize-handle:hover,
.resize-handle.active {
    background: linear-gradient(90deg, #a5b4fc 0%, #6366f1 50%, #a5b4fc 100%);
}

.resize-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 40px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 1px;
}

.resize-handle:hover::before,
.resize-handle.active::before {
    background: rgba(255, 255, 255, 0.5);
}

/* Main Content Panel */
.main-panel {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    padding: 0 1.5rem !important;
    /* Balanced left/right padding */
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .split-view-container {
        flex-direction: column;
    }

    .sidebar-panel {
        width: 100% !important;
        min-width: unset;
        max-width: unset;
        height: auto;
        max-height: 40vh;
    }

    .resize-handle {
        display: none;
    }

    .main-panel {
        flex: 1;
    }
}

/* Hide old sidebar styles (no longer needed) */
.sidebar {
    display: none !important;
}

/* Dashboard Guidance Action Buttons */
.btn-guidance {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    width: 100%;
    transition: all 0.2s ease;
}

.btn-guidance:hover {
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==================== Strategy Cards Clickable ==================== */

.strategy-card-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.strategy-card-clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.strategy-card-clickable:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.strategy-card-clickable:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Strategy Parameter Badge */
.strategy-param-badge {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}
/* ==================== Skeleton Loading Placeholders ==================== */

@keyframes skeleton-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

.skeleton {
    display: inline-block;
    background: linear-gradient(90deg, #e5e7eb 0%, #f3f4f6 50%, #e5e7eb 100%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1em;
    display: inline-block;
    min-width: 60px;
}

.skeleton-text.sm { width: 40px; height: 0.8em; }
.skeleton-text.md { width: 80px; }
.skeleton-text.lg { width: 120px; }

.skeleton-kpi {
    display: inline-block;
    height: 2rem;
    width: 80%;
    margin: 0.5rem 0;
}

.skeleton-cell {
    height: 1rem;
    width: 100%;
    display: block;
}

.skeleton-chart {
    height: 200px;
    width: 100%;
    border-radius: 8px;
}

.skeleton-table-row {
    height: 1rem;
    width: 90%;
    margin: 0 auto;
    border-radius: 4px;
}

/* ==================== Tab Pane Visibility Fix ==================== */

/* Ensure non-active tab panes are completely hidden */
#stockInfoModal .tab-pane:not(.active) {
    display: none !important;
}

#stockInfoModal .tab-pane.active {
    display: block !important;
}
/* Keep toggle labels readable on the left while aligning the controls to the
   right edge of their available row. Bootstrap's default switch floats left. */
.form-switch.switch-control-end {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding-left: 0;
}

.form-switch.switch-control-end > .form-check-input {
    order: 2;
    float: none;
    flex: 0 0 auto;
    margin: 0 0 0 auto;
}

.form-switch.switch-control-end > .form-check-label {
    order: 1;
    min-width: 0;
}

.form-switch.switch-control-end > .form-text {
    order: 3;
    flex-basis: 100%;
    margin-top: 0;
}
