@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

:root {
    --primary-color: #38b6ff;
    --secondary-color: #7ed957;
    --dark-color: #000000;
    --light-color: #ffffff;
    --bs-dark-rgb: 0,0,0;
    --bs-primary: var(--primary-color);
    --bs-primary-rgb: 56,182,255;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f7;
    color: var(--dark-color);
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

img {
    max-width: 100%;
    height: auto;
}

body.auth-bg {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    align-items: center;
    justify-content: center;
    color: var(--light-color);
}

/* Login and signup layouts */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    max-width: 600px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}


/* Additional page-specific utilities */
.payment-date {
    font-weight: bold;
    margin-bottom: 1rem;
}

.payment-option {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color-translucent);
    border-radius: 4px;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    max-width: 500px;
    color: var(--bs-body-color);
    transition: background-color 0.2s ease;
}

.payment-option:hover {
    background: var(--bs-secondary-bg);
}

#countdown {
    font-weight: normal;
    margin-left: 0.5rem;
}


@media (min-width: 768px) {
    #sidebar {
        width: 250px;
        transition: transform 0.35s ease;
    }
    #sidebar.collapse:not(.show) {
        display: block;
        transform: translateX(-250px);
    }
    #sidebar.collapsing {
        height: auto;
        width: 250px;
    }
}

# Ensure the sidebar spans the full viewport height and uses a solid colour
# scheme. Links inherit the sidebar text colour.
#
# The navbar toggle moved to the left in all pages makes it easier to reveal
# this sidebar on smaller screens.
#
# Sidebar base styling
#
# Note: background colour is set here rather than relying on Bootstrap utility
# classes so it remains solid even when the component collapses/expands.
#
# Use a dark theme to distinguish the navigation from the main content.

#sidebar {
    min-height: 100vh;
    background-color: var(--dark-color);
    color: var(--light-color);
}

#sidebar .nav-link {
    color: var(--light-color);
}

#sidebar .nav-link.active {
    font-weight: bold; color: var(--secondary-color);
}



/* Center page content but keep the navbar full width */
body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 100vh;
}


.navbar {
    background-color: var(--dark-color) !important;
    color: var(--light-color);
    width: 100%;
}

body > main.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}

main.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    max-width: 1600px; /* expand admin layout on large screens */
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    margin: 0 auto;
    text-align: left;
}


main.container > h1,
main.container > h2 {
    margin-bottom: 1.5rem;
}

#available-leads {
    /* Offset anchor scrolling so the heading is visible below the fixed navbar */
    scroll-margin-top: 96px;
}

.empty-state {
    margin: 2rem 0;
    color: var(--bs-secondary-color);
}

/* Tighter layout for the home page */
.home-container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
}

/* Admin page field selection */
.admin-fields-form {
    max-width: 600px;
}

.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}
.field-dropdown-menu {
    max-height: 200px;
    overflow-y: auto;
}

/* Ensure dropdown expands without covering adjacent buttons */
.position-static .field-dropdown-menu.show {
    position: static;
}

/* Collapsible field option panel aligned left of search */
.field-options {
    width: 250px;
}


.wide-form {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 1rem;
}

.navbar-brand, .navbar .nav-link {
    color: var(--light-color) !important;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
    padding: 0.75rem 1rem;
}
.navbar .nav-link:hover {
    transform: translateY(-2px);
}
.navbar .nav-link.active { color: var(--secondary-color) !important; }
.navbar-toggler {
    padding: 0.75rem 1rem;
}

/* Visually scale up the logo without affecting navbar height */
.navbar-brand img {
    height: 40px;
    transform: scale(1.5);
    transform-origin: left center;
}

.btn {
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 48px;
    border-radius: 6px;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
}
.btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.btn:active {
    transform: scale(0.97);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.btn-primary {
    background-image: linear-gradient(to bottom right, var(--primary-color), #5cc8ff);
    border: none;
}
.btn-primary:hover,
.btn-primary:focus {
    background-image: linear-gradient(to bottom right, #2fa8ff, var(--primary-color));
}
.btn-secondary {
    background-image: linear-gradient(to bottom right, var(--secondary-color), #a4f27d);
    border: none;
}
.btn-secondary:hover,
.btn-secondary:focus {
    background-image: linear-gradient(to bottom right, #6ed45a, var(--secondary-color));
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    color: #fff !important;
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}
.btn-outline-primary:active {
    transform: scale(0.97);
}
.form-control {
    min-height: 48px;
    font-size: 1rem;
}

.card {
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    background: linear-gradient(#fff, #f9f9f9);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

main.container > .card,
main.container > form.card,
main.container > section.card {
    max-width: 700px;
    margin: 1rem 0;
}

#db-browser-container {
    overflow-x: auto;
}
#db-browser-table {
    table-layout: fixed;
    width: max-content;
}
#db-browser-table th,
#db-browser-table td {
    white-space: nowrap;
}
#db-browser-table th {
    position: relative;
}
#db-browser-table .col-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
}


/* Chatbot styles */
#chatbot-toggle {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1000;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    background-image: linear-gradient(to bottom right, var(--primary-color), #5cc8ff);
    color: #fff;
    border: none;
    animation: bounce 2s infinite;
}
#chatbot-toggle:hover {
    transform: translateY(-2px) scale(1.05);
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
.chatbot-panel { position: fixed; bottom: 4rem; right: 1rem; width: 300px; max-height: 400px; background: #fff; border: 1px solid #ccc; border-radius: 8px; display: none; flex-direction: column; box-shadow: 0 4px 8px rgba(0,0,0,0.1); overflow: hidden; z-index: 1000; color: #000; }
.chatbot-panel.open { display: flex; }
.chatbot-header { background: var(--primary-color); color: #000; padding: 0.5rem; font-weight: bold; }
.chatbot-body { flex: 1; padding: 0.5rem; overflow-y: auto; }
.chatbot-form { display: flex; border-top: 1px solid #ccc; }
.chatbot-input { flex: 1; border: none; padding: 0.5rem; }
.chatbot-input:focus { outline: none; }
.chatbot-send { border: none; background: var(--primary-color); color: #000; padding: 0 0.75rem; cursor: pointer; }
.chatbot-msg { margin-bottom: 0.5rem; padding: 0.4rem 0.6rem; border-radius: 10px; max-width: 80%; word-wrap: break-word; }
.chatbot-msg.user { align-self: flex-end; background: var(--primary-color); color: #000; }
.chatbot-msg.bot { background: var(--bs-secondary-bg); color: #000; }
.chatbot-typing { font-style: italic; padding: 0.4rem; }

/* Home page grid layout */
.home-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 2rem;
    flex: 1;
    min-height: 0;
}

@media (min-width: 768px) {
    .home-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .home-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.home-grid .card {
    height: 100%;
    margin: 0; /* ensure uniform gap defined by grid */
}
.home-grid .card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* prevent buttons from stretching full width */
}

@media (max-width: 767.98px) {
    .navbar-nav {
        text-align: center;
        flex-wrap: wrap;
    }
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
}

/* Kanban styles */
.kanban-board {
    gap: 1rem;
}
.kanban-column {
    min-height: 300px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.5rem;
}
.kanban-item {
    cursor: move;
}

/* Reveal animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.scroll-reveal.show {
    opacity: 1;
    transform: none;
}

/* Self Help styles */
.diagnostic-checklist .form-check {
    transition: background-color 0.2s ease;
    padding: 0.5rem;
    border-radius: 4px;
}
.diagnostic-checklist .form-check:hover {
    background-color: var(--bs-secondary-bg);
}
.diagnostic-checklist .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
}

.stepped-checklist .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
}

#diag-progress {
    transition: width 0.3s ease;
}

.progress-full-width {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

#setupProgress {
    transition: width 0.3s ease;
}
.progress-theme-fast { background-color: var(--primary-color); }
.progress-theme-affordable { background-color: var(--secondary-color); }
.progress-theme-reliable { background-color: #ffc107; }
.setup-step { transition: opacity 0.3s ease; }

/* Home page icons */
.card-title .bi {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-right: 0.25rem;
}

/* Celebration animations */
.celebrate-logo {
    animation: zoom-fade 2.5s ease-in-out forwards;
}

@keyframes zoom-fade {
    0% {
        opacity: 0;
        transform: scale(0.6);
    }
    30% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}


