/* Global application styles */

/* Prevent horizontal scrolling on all pages */
body, html {
    overflow-x: hidden;
    max-width: 100vw;
}

#_pages_plugin_container {
    overflow-x: hidden;
}

.content-overlay {
    overflow-x: hidden;
}

/* Increase max-width for larger screens */
@media (min-width: 1400px) {
    .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
        max-width: 2000px;
    }
}

/* Landing page hover effects */
.hover-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

/* Remove button hover effect */
.hover-danger:hover {
    color: #dc3545 !important;
    transform: scale(1.15);
}

/* Custom modal width for waterfall create table modal */
.waterfall-create-modal-custom .modal-dialog {
    --bs-modal-width: 900px;
    max-width: 900px;
}

/* Custom modal width for waterfall query modal - almost full screen */
.waterfall-query-modal-custom .modal-dialog {
    --bs-modal-width: 95vw;
    max-width: 95vw;
    height: 90vh;
}

.waterfall-query-modal-custom .modal-content {
    height: 90vh;
}

.waterfall-query-modal-custom .modal-body {
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

/* Light orange background for waterfall query modal header and footer */
.waterfall-query-modal-custom .modal-header {
    background-color: rgba(253, 126, 20, 0.18);
}

.waterfall-query-modal-custom .modal-footer {
    background-color: rgba(253, 126, 20, 0.18);
}

/* ICTerminal page styles */
.terminal-hero {
    /* Keep simple spacing; no special divider so first row matches other rows */
    padding: 20px 0;
}
.terminal-hero .logo { max-height: 64px; }

/* stronger card hover and reveal description */
.terminal-card.hover-card {
    transition: transform 200ms ease, box-shadow 200ms ease;
}
.terminal-card.hover-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 12px 36px rgba(14,30,60,0.14) !important;
    /* subtle background tint on hover (teal, darker tone) */
    background-color: rgba(0,107,107,0.06);
}

.terminal-card .card-desc {
    /* Hide description by default, shown on hover */
    max-height: 0;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 160ms ease, transform 160ms ease, max-height 160ms ease;
    overflow: hidden;
    margin: 0; /* remove default paragraph margin when collapsed */
}
.terminal-card.hover-card:hover .card-desc {
    max-height: 100px; /* allow space for description text */
    opacity: 1;
    transform: translateY(0);
    margin-top: 0.5rem; /* restore spacing when visible */
}

/* small chevron appears on hover */
.terminal-card .card-link-chevron { display: none !important; }

/* placeholder for cards without github links - completely hidden */
.terminal-card .card-placeholder {
    max-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* GitHub icons area (hidden until hover) */
.terminal-card .card-github {
    max-height: 0;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 160ms ease, transform 160ms ease, max-height 160ms ease;
    overflow: hidden;
    margin: 0;
}
.terminal-card.hover-card:hover .card-github {
    max-height: 50px;
    opacity: 1;
    transform: translateY(0);
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.github-icon { color: #008080; }
.card-github a:hover .github-icon { color: #ffb703; }

/* ensure cards have a consistent minimum height so rows don't jump */
.terminal-card { 
    min-height: 220px; /* increased to accommodate description + github links on hover */
    display: flex; 
    flex-direction: column; 
}
.terminal-card .card-body { 
    flex: 1 1 auto; 
    display: flex;
    justify-content: center; /* horizontally center */
}

/* The content wrapper should fill the card body and center vertically always */
.terminal-card .card-content-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center; /* always keep vertically centered */
    width: 100%;
}

/* icon color categories */

/* Teal + Amber palette */
/* Primary teal */
.icon-data { color: #008080; }
.icon-trade { color: #008080; }
.icon-tools { color: #008080; }
.icon-docs { color: #008080; }

/* primary card accent (teal) */
.terminal-card.primary { border-left: 4px solid #008080; background-color: rgba(0,128,128,0.04); }

/* focus style for keyboard users */
.terminal-card:focus-within, .terminal-card:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0,128,128,0.08) !important;
}

/* Complement / warning color (amber) - used for small accent needs */
.accent-amber { color: #ffb703 !important; }

/* Gentle background tint for the terminal area if needed */
.terminal-bg-tint { background-color: #f3fbfb; }

/* If a card in the hero row was marked 'primary', remove that special accent
   so the first row visually matches other rows. This overrides any server-side
   class assignment for hero-row cards. */
.terminal-hero .terminal-card.primary,
.terminal-hero .terminal-card {
    border-left: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* Landing page layout - ensure full height and footer at bottom */
/* The wrapper should account for navbar height, not be 100vh itself */
.landing-page-wrapper {
    min-height: calc(100vh - 74px); /* subtract navbar height (typical Bootstrap navbar is ~56px) */
    display: flex;
    flex-direction: column;
}

.landing-content-wrapper {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    padding-left: 12px;
    padding-right: 12px;
    padding-top: 1rem;
}

/* Remove padding from the navbar's content column for landing page */
#landing-landing-tab-content {
    margin-left: -12px !important;
    margin-right: -12px !important;
    margin-top: 0 !important;
}

/* Landing page footer styles */
.landing-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Social media links */
.footer-social-link {
    color: #6c757d;
    transition: color 0.2s ease;
    text-decoration: none;
}

.footer-social-link:hover {
    color: #008080;
}

/* Navigation links in footer */
.footer-nav-link {
    color: #6c757d;
    text-decoration: none;
    padding: 0 1rem;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    border-right: 1px solid #dee2e6;
}

.footer-nav-link:last-child {
    border-right: none;
}

.footer-nav-link:hover {
    color: #008080;
}

/* Footer logo */
.footer-logo {
    height: 20px;
    opacity: 0.7;
    margin-left: 0.5rem;
}

/* Responsive footer for mobile */
@media (max-width: 768px) {
    .footer-nav-link {
        display: block;
        border-right: none;
        padding: 0.5rem 0;
        text-align: center;
    }
}

/* ICTerminal page layout and footer */
#terminal-terminal-tab-content {
    margin-left: -12px !important;
    margin-right: -12px !important;
    margin-top: 0 !important;
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
}

.terminal-page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 74px); /* ensure full height minus navbar */
    margin-left: -12px; /* break out of parent column padding */
    margin-right: -12px;
}

.terminal-content-wrapper {
    flex: 1 0 auto;
    padding-left: 12px;
    padding-right: 12px;
    padding-top: 1rem;
}

.terminal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    margin-top: auto; /* push to bottom */
}

/* Configuration Tab - Variable Selection Cards */
.hover-shadow {
    transition: all 0.2s ease;
}

.hover-shadow:hover {
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1) !important;
    border-color: #0d6efd !important;
    background-color: #ffffff !important;
}

/* Configuration Tab - Add SL/TP Button Hover */
#config-tab-add-sl-btn:hover {
    border-style: solid !important;
    background-color: transparent !important;
    color: #dc3545 !important;
}

#config-tab-add-tp-btn:hover {
    border-style: solid !important;
    background-color: transparent !important;
    color: #198754 !important;
}

/* Configuration Tab - Advanced Parameters Accordion */
.accordion-button:not(.collapsed) {
    background-color: #ffffff !important;
    color: #212529 !important;
}

/* Inline Subtab Navigation - Horizontal Design with Indent */
.inline-subtab-bar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0 2rem;
    padding-left: var(--subtab-indent, 2rem); /* Dynamic indent calculated by JS */
    margin-bottom: 1rem; /* Add spacing below subtab bar */
}

.inline-subtab-nav {
    display: flex;
    gap: 0;
    margin-bottom: -1px;
}

.inline-subtab {
    padding: 0.65rem 1rem !important; /* Match px-3 (1rem = 16px) */
    border: none !important;
    border-bottom: 2px solid transparent !important;
    background-color: transparent !important;
    color: #495057 !important; /* Match main navbar color */
    font-weight: normal !important; /* Remove bold */
    font-size: 0.9rem; /* Match main navbar font size */
    font-family: inherit !important; /* Use default font */
    transition: all 0.2s ease;
    text-decoration: none !important;
    border-radius: 0 !important;
    cursor: pointer !important;
}

.inline-subtab:hover {
    color: #495057 !important;
    background-color: rgba(255, 255, 255, 0.6) !important;
    border-bottom-color: #adb5bd !important;
}

.inline-subtab-active {
    color: #0d6efd !important;
    background-color: transparent !important;
    border-bottom-color: #0d6efd !important;
}

.inline-subtab-active:hover {
    color: #0d6efd !important;
    background-color: transparent !important;
    border-bottom-color: #0d6efd !important;
}