/* ===========================================================================
   Laser CRM — Custom Stylesheet (Bootstrap 5 base)
   =========================================================================== */

/* ---------- Typefaces ---------- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

* {
    font-family: 'Montserrat', sans-serif !important;
}

/* ---------- Brand Colour Variables ---------- */
:root {
    /* Primary brand colours — match e-portfolio laserLearningLogo gradient */
    --color-one: #660066;
    --color-two: #00c5da;
    
    /* RGB variants for rgba() usage */
    --color-one-rgb: 102, 0, 102;
    --color-two-rgb: 0, 197, 218;
    
    /* Derived colours */
    --color-one-dark: #990099;
    --color-two-dark: #008899;
    --scrollbar-top: #006797;

    --color-two-dark-rgb: 0, 136, 153;
    
    /* Gradient variants (matching e-portfolio global_1783942313.css) */
    --gradient-primary: linear-gradient(-30deg, rgba(var(--color-one-rgb), 1), rgba(var(--color-two-rgb), 1));
    --gradient-primary-light: linear-gradient(-30deg, rgba(var(--color-one-rgb), 0.4), rgba(var(--color-two-rgb), 0.4));
    --gradient-primary-medium: linear-gradient(-30deg, rgba(var(--color-one-rgb), 0.7), rgba(var(--color-two-rgb), 0.7));
    --gradient-primary-fade: linear-gradient(-30deg, rgba(var(--color-one-rgb), 0.3), rgba(var(--color-two-rgb), 0.3));
    --gradient-primary-subtle: linear-gradient(-30deg, rgba(var(--color-one-rgb), 0.2), rgba(var(--color-two-rgb), 0.2));
    --gradient-primary-gossamer: linear-gradient(-30deg, rgba(var(--color-one-rgb), 0.1), rgba(var(--color-two-rgb), 0.1));
    --gradient-primary-dark: linear-gradient(-30deg, rgba(196, 0, 196, 0.5), rgba(var(--color-two-rgb), 0.5));

    --gradient-body-bg: linear-gradient(-90deg, rgba(var(--color-one-rgb), 0.3), rgba(var(--color-two-rgb), 0.3));

    --primary-bg-light: #fff;
    --secondary-bg-light: #ececec;
    --tertiary-bg-light: #d5d5d5;
    
    /* Highlight colours */
    --highlight-color: rgba(var(--color-one-rgb), 0.4);
    --highlight-color-subtle: rgba(var(--color-one-rgb), 0.15);
    --highlight-color-hover: rgba(var(--color-one-rgb), 0.6);
    --highlight-color-dark: rgba(var(--color-two-rgb), 0.4);
    --highlight-color-subtle-dark: rgba(var(--color-two-rgb), 0.15);
    --highlight-color-hover-dark: rgba(var(--color-two-rgb), 0.6);

    /* Input background/border colours (from e-portfolio global) */
    --input-bg-light: #f5f5f5;
    --input-border-light: #ccc;
    --input-bg-dark: #1e1e1e;
    --input-border-dark: #444;

    /* Button gradient variants (from e-portfolio global) */
    --gradient-button-default: linear-gradient(-30deg, rgba(var(--color-one-rgb), 0.4), rgba(var(--color-two-rgb), 0.4));
    --gradient-button-hover: linear-gradient(-30deg, rgba(var(--color-one-rgb), 1), rgba(var(--color-two-rgb), 1));
    --gradient-button-active: linear-gradient(-30deg, rgba(var(--color-one-dark-rgb), 0.8), rgba(var(--color-two-rgb), 0.8));
    --gradient-button-dark: linear-gradient(-30deg, rgba(var(--color-one-dark-rgb), 0.8), rgba(var(--color-two-rgb), 0.8));
    --gradient-button-dark-hover: linear-gradient(-30deg, rgba(var(--color-one-rgb), 1), rgba(var(--color-two-dark-rgb), 1));
    --gradient-button-dark-active: linear-gradient(-30deg, rgba(var(--color-one-rgb), 0.8), rgba(var(--color-two-rgb), 0.8));

    --dark-background-dark: linear-gradient(-30deg, rgba(var(--color-one-rgb), 0.85), rgba(var(--color-two-dark-rgb), 0.85));

    --bs-modal-width: 800px;
}

.modal {
    --bs-modal-width: 800px;
}

a {
    color: var(--color-one);
}

button.btn-close:hover {
    background: transparent var(--bs-btn-close-bg) center/1em auto no-repeat !important;
}

/* ---------- Sidebar ---------- */

.crm-sidebar {
    position: fixed;
    top: 70px; /* below the fixed-top navbar */
    left: 10px;
    bottom: 10px;
    width: 240px;
    z-index: 1030;
    overflow-y: auto;
    transition: transform 0.2s ease;
    background: var(--gradient-primary-dark);
    border-radius: 10px;
}

.sidebar-inner {
    padding-top: 1rem;
}

.crm-nav-link {
    color: rgba(255, 255, 255, 0.7);
    border-radius: 100px;
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.crm-nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.crm-nav-link.active {
    color: #fff;
    background-color: var(--gradient-primary);
    font-weight: 500;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

li.nav-item.px-3 {
    padding: 0 !important;
}

/* ---------- Top Bar ---------- */

.crm-topbar {
    height: 60px !important;
    z-index: 1040;
    background-color: rgba(100, 100, 100, 0.5) !important;
    background: var(--gradient-primary-fade);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

a.navbar-brand {
    padding: 5px;
    border-radius: 10px;
    background: #fff;
}

nav.navbar div.container-fluid {
    padding: 0 10px;
}

nav.navbar.fixed-top {
    width: 100%;
    left: 0;
    top: 0;
    border-radius: 0;
    padding: 0 8px;
}

.crm-search {
    flex: 1;
    max-width: 480px;
    margin: 0 auto;
}

.crm-search-input:focus {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: transparent;
    box-shadow: none;
}

.crm-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Search results dropdown */
.crm-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-height: 360px;
    overflow-y: auto;
    z-index: 1050;
}

.crm-search-results a {
    display: block;
    padding: 0.6rem 1rem;
    color: #212529;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}

.crm-search-results a:hover {
    background-color: #f8f9fa;
}

/* ---------- Main Content Area ---------- */

.crm-main {
    margin-left: 270px; /* matches sidebar width */
    margin-top: 80px !important;
    margin-right: 20px;
    min-height: calc(100vh - 150px);
    padding: 0 !important;
}

.deal-column {
    display: flex;
    flex-flow: column nowrap;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 5px;
}

.deal-value {
    align-items: center;
}

.container-fluid {
    padding: 0 !important;
}

.crm-footer {
    background: var(--primary-bg-light) var(--gradient-primary-gossamer);
    margin-top: 20px;
}

.modal {
    background-color: transparent !important;
    background: var(--dark-background-dark) !important;
    display: none;
    backdrop-filter: blur(5px);
    overflow-y: auto;
    padding: 20px 0 80px 0;
}

/* ---------- Card Component ---------- */

.crm-card {
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
}

.crm-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ---------- KPI Cards ---------- */

.crm-kpi-card {
    border-radius: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.crm-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

/* ---------- Quick Action Buttons ---------- */

.crm-quick-action-btn {
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.crm-quick-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ---------- Activity Feed ---------- */

.crm-activity-feed .list-group-item {
    padding: 0.75rem;
    transition: background-color 0.1s ease;
}

.crm-activity-feed .list-group-item:hover {
    background-color: #f8f9fa;
}

.crm-activity-icon i {
    font-size: 1.1rem;
    line-height: 1.6;
}

.crm-activity-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

div.crm-activity-icon {
    border-radius: 5px !important;
    background: var(--gradient-primary-fade);
    display: flex;
    flex-flow: column nowrap;
    align-items: center;
    justify-content: center;
}

/* ---------- Tasks List ---------- */

.crm-tasks-list .list-group-item {
    padding: 0.6rem 1rem;
}

.crm-priority-dot {
    flex-shrink: 0;
}

/* ---------- Badge Component ---------- */

.crm-badge {
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ---------- Form Components ---------- */

.crm-form-group .form-control:focus,
.crm-form-group .form-select:focus {
    border-color: var(--color-two);
    box-shadow: 0 0 0 0.2rem rgba(var(--color-two-rgb), 0.15);
}

/* ---------- Flash Alerts ---------- */

.crm-alert-flash {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-1rem); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Notification Dropdown ---------- */

.crm-notification-dropdown {
    min-width: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ---------- Kanban (Pipeline Board) ---------- */

.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: 400px;
    flex-flow: row wrap;
}

.kanban-column {
    min-width: 280px;
    max-width: 300px;
    background: #f5f7fa;
    border-radius: 8px;
    flex-shrink: 0;
}

.kanban-header {
    padding: 1rem;
    border-radius: 8px 8px 0 0;
    color: white;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-cards {
    padding: 1rem;
    min-height: 200px;
}

.kanban-card {
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.kanban-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.kanban-cards.drag-over {
    background-color: #e3f2fd;
    border-radius: 4px;
}

.nav-link:focus, .nav-link:hover {
    color: #fff !important;
}

form.delete-task-form button.list-group-item {
    background: transparent !important;
    font-weight: 400;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .crm-sidebar {
        transform: translateX(-105%);
    }

    .crm-sidebar.show {
        transform: translateX(0);
    }

    .crm-main {
        margin-left: 10px;
    }

    .container.loginContainer {
        width: calc(100% + 10px);
        margin-right: 0;
    }

    .kanban-board {
        flex-direction: column;
    }

    .kanban-column {
        min-width: auto;
        max-width: none;
    }
}

/* ---------- Scrollbar Styling (optional) ---------- */

.crm-sidebar::-webkit-scrollbar {
    width: 4px;
}

.crm-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

/* ---------- Kanban Header Gradient ---------- */

.kanban-header {
    padding: 1rem;
    border-radius: 8px 8px 0 0;
    color: white;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gradient-primary);
}

/* ===========================================================================
   Global Form Element Styles (from e-portfolio global_1783942313.css)
   =========================================================================== */

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus,
button:focus {
    outline: none;
}

input, textarea, select {
    transition: box-shadow 0.2s linear;
    -o-transition: box-shadow 0.2s linear;
    -moz-transition: box-shadow 0.2s linear;
    -webkit-transition: box-shadow 0.2s linear;
    border: 2px solid var(--input-border-light);
    background-color: var(--input-bg-light);
    border-radius: 10px;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus,
select:focus {
    outline: none;
}

/* ---------- Nice Checkbox (custom toggle) ---------- */

input.niceCheckbox {
    display: none;
}

input.niceCheckbox + label {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

input.niceCheckbox + label > span:first-of-type {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--color-one);
    flex-shrink: 0;
}

input.niceCheckbox + label > span:first-of-type > span {
    display: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-one);
}

input.niceCheckbox:checked + label > span:first-of-type > span {
    display: block;
}

body.dark input.niceCheckbox:checked + label > span:first-of-type > span {
    background-color: var(--color-two);
}

/* ---------- Button Styles (from e-portfolio global) ---------- */

button:not(.list-group-item):not(.btn-close):not(.btn-outline-light):not(.ql-bold):not(.ql-italic):not(.ql-underline):not(.ql-link):not(.ql-strike):not(.ql-list):not(.ql-blockquote):not(.ql-code-block):not(.ql-clean),
button.fadeBackground,
a.fadeBackgroundButton,
a.btn,
button.btn {
    border: 0 !important;
    background: #fff var(--gradient-button-default) !important;
    border-radius: 100px !important;
    padding: 5px 10px !important;
    color: var(--color-one) !important;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-decoration: none !important;
}

a.btn *,
button:not(.list-group-item):not(.ql-bold):not(.ql-italic):not(.ql-underline):not(.ql-link):not(.ql-strike):not(.ql-list):not(.ql-blockquote):not(.ql-code-block):not(.ql-clean) *,
button:not(.ql-bold):not(.ql-italic):not(.ql-underline):not(.ql-link):not(.ql-strike):not(.ql-list):not(.ql-blockquote):not(.ql-code-block):not(.ql-clean) svg * {
    color: var(--color-one);
    fill: var(--color-one) !important;
}

button:not(.list-group-item):not(.btn-close):not(.ql-bold):not(.ql-italic):not(.ql-underline):not(.ql-link):not(.ql-strike):not(.ql-list):not(.ql-blockquote):not(.ql-code-block):not(.ql-clean):hover,
button.fadeBackground:hover,
a.fadeBackgroundButton:hover,
a.btn:hover,
button.btn:hover {
    background: var(--gradient-button-hover) !important;
    box-shadow: 0 0 0 0 !important;
    transform: none !important;
    color: #fff !important;
    fill: #fff !important;
    transition: none !important;
}

button:not(.list-group-item):not(.ql-bold):not(.ql-italic):not(.ql-underline):not(.ql-link):not(.ql-strike):not(.ql-list):not(.ql-blockquote):not(.ql-code-block):not(.ql-clean):hover *,
button:not(.list-group-item):not(.ql-bold):not(.ql-italic):not(.ql-underline):not(.ql-link):not(.ql-strike):not(.ql-list):not(.ql-blockquote):not(.ql-code-block):not(.ql-clean):hover svg *,
button.fadeBackground:hover *,
a.fadeBackgroundButton:hover *,
a.btn:hover *,
button.btn:not(.ql-bold):not(.ql-italic):not(.ql-underline):not(.ql-link):not(.ql-strike):not(.ql-list):not(.ql-blockquote):not(.ql-code-block):not(.ql-clean):hover * {
    color: #fff !important;
    fill: #fff !important;
}

.list-group-item {
    border: 0 !important;
}

div.ql-editor {
    min-height: 200px;
}

form#globalSearchForm {
    width: 100%;
    margin: 0;
}

form#profileForm {
    margin-bottom: 20px;
}

img.profile-image {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

div.user-card {
    padding: 5px;
    min-width: 110px;
    height: 42px;
    border-radius: 10px;
    background: var(--primary-bg-light) var(--gradient-primary-gossamer) !important;
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

div.user-card:hover {
    cursor: pointer;
    background: var(--primary-bg-light) var(--gradient-primary-fade) !important;
}

div.user-card__avatar {
    height: 100%;
    aspect-ratio: 1/1;
    border-radius: 50%;
    overflow: hidden;
    background: var(--gradient-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 0.9em;
    line-height: 0.9em;
    color: #fff;
}

p.user-card-name {
    font-size: 0.8em;
    line-height: 1.2em;
    font-weight: 700;
    margin-bottom: 0;
    text-align: left;
    flex-grow: 1;
}

ul.dropdown-menu {
    border: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

div.user-card img.user-card__avatar-img {
    height: 100%;
    width: auto;
}

button.uploadProfileImage {
    display: block;
    position: relative;
    margin: 0 auto 20px auto;
}

li.px-3 {
    padding: 0 !important;
}

div.row.g-2.mb-4 {
    gap: 10px;
}

div.card.activityTimeline {
    margin-bottom: 20px;
}

li.companyNameDisplay span.companyNameDisplay {
    text-align: right;
}

@media (max-width: 768px) {
    div.row.g-2.mb-4 {
        flex-flow: column nowrap;
        align-items: stretch;
        justify-content: flex-start;
        gap: 5px;
    }

    .mb-4 {
        --bs-gutter-y: 1rem;
    }

    div.row.g-2.mb-4 > a.btn,
    div.row.g-2.mb-4 > button {
        margin-top: 0;
    }
}

div.input-group input {
    /*border-radius: 0 5px 5px 0 !important;*/
    border-radius: var(--bs-border-radius) !important;
    padding: .375rem 2.25rem .375rem .75rem !important;
    margin-right: 10px;
    font-size: 1rem !important;
}

h1 {
    font-weight: 700 !important;
}

/* Clickable table rows (companies list) */
.clickable-row { cursor: pointer; }
.clickable-row:hover td:last-child,
.clickable-row:hover td:nth-last-child(3),
.clickable-row:hover td:nth-last-child(2) {
    color: #0d6efd;
}

main.crm-main {
    background: transparent !important;
}

div.avatar-circle {
    background: var(--color-one);
    background-color: var(--color-one) !important;
    font-size: 0.7em;
}

span.platformBadge {
    background: var(--gradient-primary);
    color: #fff;
    margin-bottom: 10px;
}

div.linkedAccountCard {
    padding: 10px !important;
}

button.icon_only_button {
    border-radius: 10px !important;
    padding: 5px !important;
}

body {
    background-color: transparent !important;
    background: var(--gradient-body-bg) !important;
}

.card {
    border-width: 0 !important;
    box-shadow: 0 3px 10px 5px rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.card-header,
.card-header:first-child {
    border-bottom: 0;
    background: var(--gradient-primary-gossamer);
    border-radius: 10px 10px 0 0;
}
/* ============================================================
   Quill Editor Toolbar Overrides
   Prevent global CRM button styles from affecting Quill's toolbar buttons.
   ============================================================ */

/* Reset background gradients on all buttons inside Quill toolbar */
.ql-toolbar button,
.ql-toolbar .ql-formats button,
.ql-toolbar select {
    background: transparent !important;
    box-shadow: none !important;
}

/* Reset child element styles (icons, SVGs) inside Quill toolbar buttons */
.ql-toolbar button *,
.ql-toolbar .ql-formats button *,
.ql-toolbar select * {
    background: transparent !important;
    color: inherit !important;
}

/* Hover states for Quill toolbar buttons */
.ql-toolbar button:hover,
.ql-toolbar .ql-formats button:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

.ql-toolbar button:hover *,
.ql-toolbar .ql-formats button:hover * {
    color: inherit !important;
}

/* Active/pressed state for Quill toolbar buttons */
.ql-toolbar button.ql-active,
.ql-toolbar .ql-picker-item.ql-selected {
    background: rgba(0, 0, 0, 0.1) !important;
}

.ql-toolbar button.ql-active *,
.ql-toolbar .ql-picker-item.ql-selected * {
    color: inherit !important;
}

/* Focus state for accessibility */
.ql-toolbar button:focus,
.ql-toolbar button:focus-visible {
    outline: 2px solid var(--bs-primary) !important;
    outline-offset: -2px !important;
}

/* Separator styling between toolbar groups */
.ql-toolbar .ql-formats::before {
    content: '';
    display: inline-block;
    width: 1px;
    height: 16px;
    background: rgba(0, 0, 0, 0.2);
    margin: 0 8px;
    vertical-align: middle;
}

/* Remove separator before first format group */
.ql-toolbar .ql-formats:first-child::before {
    display: none;
}
