/* ==========================================================================
   PION Salesforce — Light Glassmorphism Theme
   ========================================================================== */

/* --- CSS Variables --- */
:root {
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-blur: 20px;
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-text: #334155;
    --color-heading: #1e293b;
    --color-muted: #64748b;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
    --bs-border-radius: 8px;
    --bs-body-padding: 1rem;
    --background-dark-black-darker: #1D2125;
}

/* --- Gradient Mesh Background --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(120, 119, 198, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 177, 153, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #faf5ff 100%);
}

/* --- Typography --- */
body {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: var(--color-text);
    line-height: 1.6;
    background: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-heading);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 1rem;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease-in-out;
}

a:hover {
    color: var(--color-primary-hover);
    text-decoration: none;
}

/* --- Utility Spacing --- */
.container { padding: 1rem; }
.mt-md { margin-top: 1.5rem; }
.mb-md { margin-bottom: 1.5rem; }
.pt-md { padding-top: 1.5rem; }
.pb-md { padding-bottom: 1.5rem; }

/* --- Font Sizes --- */
.fs-7 { font-size: 0.875rem; }
.fs-8 { font-size: 0.7rem; }
.fs-9 { font-size: 0.625rem; }
.fs-10 { font-size: 0.5rem; }

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    background: rgba(255, 255, 255, 0.65) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 1px 12px rgba(99, 102, 241, 0.06);
}

/* ==========================================================================
   Sidebar / Menu Left
   ========================================================================== */
.menu-left-fixed {
    position: fixed;
    left: 0;
    top: 40px;
    width: 250px;
    height: 100%;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.55);
    border-right: 1px solid rgba(255, 255, 255, 0.35);
    padding: 20px;
    box-shadow: 1px 0 16px rgba(99, 102, 241, 0.04);
}

.container-content {
    width: 100%;
    margin-left: 250px;
    padding: 20px;
}

.sidebar {
    width: 250px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    padding: 15px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.55);
    border-right: 1px solid rgba(255, 255, 255, 0.35);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.12);
}

.sidebar-title {
    font-weight: bold;
    color: var(--color-heading);
}

.sidebar-actions {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid rgba(99, 102, 241, 0.12);
}

.sidebar-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 10px;
    margin-bottom: 30px;
    border-top: 1px solid rgba(99, 102, 241, 0.12);
}

.content {
    margin-left: 250px;
    padding: 20px;
}

/* ==========================================================================
   Nav Links
   ========================================================================== */
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    text-decoration: none;
    border-radius: 8px;
    color: var(--color-text);
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--color-primary);
}

.nav-link.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--color-primary);
    font-weight: 500;
}

.material-symbols-rounded {
    font-size: 20px;
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 20;
}

/* ==========================================================================
   Cards — Glass Effect
   ========================================================================== */
.card {
    border-radius: 12px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.18);
}

.card-header {
    background: rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.card-body {
    background: transparent;
}

/* ==========================================================================
   Shadows
   ========================================================================== */
.shadow-sm { box-shadow: 0 2px 8px rgba(99, 102, 241, 0.06) !important; }
.shadow    { box-shadow: 0 4px 16px rgba(99, 102, 241, 0.1) !important; }
.shadow-lg { box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15) !important; }

/* ==========================================================================
   Forms — Glass Inputs
   ========================================================================== */
.form-control {
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.15);
    padding: 8px 12px;
    font-size: 13px;
    line-height: 20px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--color-text);
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    background: rgba(255, 255, 255, 0.7);
}

.form-control:disabled {
    background: rgba(241, 245, 249, 0.6);
    opacity: 0.7;
}

.form-label {
    color: var(--color-muted);
    font-weight: 500;
}

.form-check-input {
    cursor: pointer;
    border: 1px solid rgba(99, 102, 241, 0.2);
    background-color: rgba(255, 255, 255, 0.5);
}

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

/* Select2 — Glass Matching */
.select2-container--default .select2-selection--single {
    border: 1px solid rgba(99, 102, 241, 0.15) !important;
    height: 36px !important;
    background: rgba(255, 255, 255, 0.5) !important;
    border-radius: 8px !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
    line-height: 36px !important;
    color: var(--color-text);
}

.select2-dropdown {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1);
}

.select2-results__option--selectable:hover {
    background: rgba(99, 102, 241, 0.08) !important;
}

.select2-container--default .select2-results__option--selected {
    background: rgba(99, 102, 241, 0.12) !important;
}

/* Task form textarea */
#form-add-task textarea {
    font-family: var(--bs-font-monospace);
    height: 600px;
    background: rgba(255, 255, 255, 0.45);
    color: var(--color-text);
    font-size: 11px;
    line-height: 24px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ==========================================================================
   Buttons — Gradient Glass
   ========================================================================== */
.btn {
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
}

.btn-secondary {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: #fff;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #64748b, #475569);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: #fff;
}

.btn-success:hover {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #fb7185, #f43f5e);
    color: #fff;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

.btn-info {
    background: linear-gradient(135deg, #22d3ee, #06b6d4);
    color: #fff;
}

.btn-info:hover {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: #fff;
}

/* ==========================================================================
   Tables — Glass
   ========================================================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.06);
    border-radius: 10px;
}

.table thead {
    background: rgba(99, 102, 241, 0.05);
    text-transform: uppercase;
    font-weight: bold;
}

.table thead th {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    color: var(--color-muted);
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:nth-child(even) {
    background: rgba(99, 102, 241, 0.02);
}

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

.table tbody td {
    padding: 12px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.06);
    color: var(--color-text);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table.table-bordered {
    border: none;
}

.table.table-bordered th,
.table.table-bordered td {
    border: 1px solid rgba(99, 102, 241, 0.08);
}

/* ==========================================================================
   Badges — Glass
   ========================================================================== */
.badge {
    font-size: 0.70rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.badge-primary, .bg-primary   { background: rgba(99, 102, 241, 0.85); color: #fff; }
.badge-secondary              { background: rgba(100, 116, 139, 0.8); color: #fff; }
.badge-success, .bg-success   { background: rgba(16, 185, 129, 0.85) !important; color: #fff; }
.badge-danger, .bg-danger     { background: rgba(244, 63, 94, 0.85) !important; color: #fff; }
.badge-warning, .bg-warning   { background: rgba(245, 158, 11, 0.85); color: #fff; }
.badge-info, .bg-info         { background: rgba(6, 182, 212, 0.85) !important; color: #fff; }
.badge-light                  { background: rgba(248, 250, 252, 0.8); color: var(--color-heading); }
.badge-dark                   { background: rgba(30, 41, 59, 0.85); color: #fff; }

.badge-outline {
    background-color: transparent !important;
    border: 2px solid currentColor;
    color: inherit;
}

.badge i {
    font-size: 1rem;
    margin-right: 5px;
}

.badge-ripple {
    position: relative;
    overflow: hidden;
}

.badge-ripple::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.badge-ripple:active::after {
    opacity: 1;
    transition: 0s;
}

/* ==========================================================================
   Alerts — Glass Tinted
   ========================================================================== */
.alert {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 10px;
    border: none;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(16, 185, 129, 0.08);
    border-left-color: #10b981;
    color: #065f46;
}

.alert-danger {
    background: rgba(244, 63, 94, 0.08);
    border-left-color: #f43f5e;
    color: #9f1239;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.08);
    border-left-color: #f59e0b;
    color: #92400e;
}

.alert-info {
    background: rgba(6, 182, 212, 0.08);
    border-left-color: #06b6d4;
    color: #155e75;
}

/* ==========================================================================
   Dropdowns — Glass Panel
   ========================================================================== */
.dropdown-menu {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.1);
    padding: 6px;
}

.dropdown-item {
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--color-text);
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--color-primary);
}

/* ==========================================================================
   Modals — Glass Overlay + Content
   ========================================================================== */
.modal-backdrop {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(31, 38, 135, 0.15);
}

.modal-header {
    border-bottom: 1px solid rgba(99, 102, 241, 0.08);
}

.modal-footer {
    border-top: 1px solid rgba(99, 102, 241, 0.08);
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */
.breadcrumb .breadcrumb-item a,
.breadcrumb .breadcrumb-item.active,
.breadcrumb-item+.breadcrumb-item::before {
    color: var(--color-muted);
}

.breadcrumb .breadcrumb-item a:hover {
    color: var(--color-primary);
}

/* ==========================================================================
   Code Blocks
   ========================================================================== */
code {
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(139, 92, 246, 0.06);
    color: #7c3aed;
    font-size: 0.85em;
}

/* ==========================================================================
   Status Dots
   ========================================================================== */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.1);
}

.dot-0 { background-color: #f59e0b; }
.dot-1 { background-color: #6366f1; }
.dot-2 { background-color: #10b981; }
.dot-3 { background-color: #f43f5e; }

/* ==========================================================================
   Separator
   ========================================================================== */
.separator {
    height: 1px;
    border-bottom: 1px dashed rgba(99, 102, 241, 0.15);
    margin: 60px 0;
}

/* ==========================================================================
   Task Log
   ========================================================================== */
.task-log-response {
    font-family: "Lucida Console", Monaco, monospace;
    overflow: scroll;
    white-space: pre;
}

/* ==========================================================================
   Sortable / Columns Matching
   ========================================================================== */
#sortable .handle { cursor: move; line-height: 38px; }
.ui-sortable-helper { display: flex; justify-content: space-between; }
.ui-sortable-helper td { width: 100%; }
.ui-sortable-placeholder { height: 100px; }

#table-columns-matching .btn-close-white { height: 28px; }
#table-columns-matching .btn-close-white { filter: none; }
[data-bs-theme="dark"] #table-columns-matching .btn-close-white { filter: invert(1); }

/* ==========================================================================
   Scrollbar — Thin & Translucent
   ========================================================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.18);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.3);
}

/* ==========================================================================
   Container Overflow
   ========================================================================== */
.container-overflow .overflow-content { overflow: visible; }

/* ==========================================================================
   Responsive — Mobile
   ========================================================================== */
@media (max-width: 768px) {
    body { font-size: 14px; }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1.1rem; }
    h6 { font-size: 1rem; }
}

@media screen and (min-width: 600px) {
    .navbar .navbar-collapse { display: none !important; }
}

@media screen and (max-width: 600px) {
    .navbar .container-fluid { justify-content: space-between !important; }
    .container-content { padding: 0; }
    .p-5 { padding: 1.5rem !important; }
    .separator { margin: 40px 0; }

    .menu-left-fixed {
        display: none;
    }

    .container-content {
        margin-left: 0;
    }
}
