/* ==========================================================================
   Cold Outreach CRM - shared design system
   Loaded once by layouts/app.php (and layouts/guest.php), so every page in
   the portal inherits it automatically through the Bootstrap classes already
   in use (.card, .btn, .table, .badge, .nav-link, .modal) - this is what
   keeps 30+ separately-written view files visually uniform.
   ========================================================================== */

:root {
    --brand: #0d47a1;
    --brand-2: #1a5fd6;
    --brand-light: #e8f0fe;
    --brand-dark: #0a1f44;
    --ink: #1c2430;
    --muted: #64748b;
    --bg: #f2f5fa;
    --surface: #ffffff;
    --border: #e7ebf2;
    --radius: .85rem;
    --radius-sm: .55rem;
    --shadow-sm: 0 1px 2px rgba(16, 30, 54, .04), 0 1px 3px rgba(16, 30, 54, .06);
    --shadow-md: 0 8px 24px -8px rgba(13, 71, 161, .18);
    --shadow-lg: 0 20px 45px -12px rgba(13, 71, 161, .28);
    --ease: cubic-bezier(.22, 1, .36, 1);
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

/* ---- page-load motion ---------------------------------------------- */

@keyframes coFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes coFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes coPulseRing {
    0%   { box-shadow: 0 0 0 0 rgba(13, 71, 161, .35); }
    100% { box-shadow: 0 0 0 8px rgba(13, 71, 161, 0); }
}

main > .page-content {
    animation: coFadeUp .45s var(--ease) both;
}

/* stat/info cards cascade in with a light stagger */
.row.g-2 > div, .row.g-3 > div {
    animation: coFadeUp .4s var(--ease) both;
}
.row.g-2 > div:nth-child(1), .row.g-3 > div:nth-child(1) { animation-delay: .02s; }
.row.g-2 > div:nth-child(2), .row.g-3 > div:nth-child(2) { animation-delay: .06s; }
.row.g-2 > div:nth-child(3), .row.g-3 > div:nth-child(3) { animation-delay: .10s; }
.row.g-2 > div:nth-child(4), .row.g-3 > div:nth-child(4) { animation-delay: .14s; }
.row.g-2 > div:nth-child(5), .row.g-3 > div:nth-child(5) { animation-delay: .18s; }
.row.g-2 > div:nth-child(6), .row.g-3 > div:nth-child(6) { animation-delay: .22s; }
.row.g-2 > div:nth-child(n+7), .row.g-3 > div:nth-child(n+7) { animation-delay: .26s; }

@media (prefers-reduced-motion: reduce) {
    main > .page-content, .row.g-2 > div, .row.g-3 > div { animation: none; }
}

/* ---- cards ------------------------------------------------------------ */

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
a.card:hover, .card.hover-lift:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.card-header {
    border-radius: var(--radius) var(--radius) 0 0 !important;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

/* dashboard-style stat tiles get a bit more presence + icon treatment */
.card .fs-4.fw-semibold, .card .fs-5.fw-semibold { color: var(--ink); }
.card .bi { transition: transform .25s var(--ease); }
.card:hover .bi.fs-4 { transform: scale(1.12); }

/* ---- buttons ------------------------------------------------------------ */

.btn {
    border-radius: var(--radius-sm);
    transition: transform .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--brand-2);
    border-color: var(--brand-2);
    box-shadow: 0 6px 16px -4px rgba(13, 71, 161, .45);
    transform: translateY(-1px);
}
.btn-outline-secondary:hover, .btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ---- tables ------------------------------------------------------------ */

.table thead.table-light th {
    background: #f8fafd;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: .72rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}
.table > tbody > tr {
    transition: background-color .15s var(--ease);
}
.table-hover > tbody > tr:hover {
    background-color: var(--brand-light);
}

/* ---- badges ------------------------------------------------------------ */

.badge {
    font-weight: 600;
    letter-spacing: .01em;
    padding: .42em .7em;
}
.badge.rounded-pill { padding: .38em .75em; }

/* ---- forms ------------------------------------------------------------ */

.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-2);
    box-shadow: 0 0 0 .2rem rgba(13, 71, 161, .12);
}

/* ---- modals -------------------------------------------------------------- */

.modal.fade .modal-dialog {
    transform: translateY(16px) scale(.98);
    transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.modal.show .modal-dialog { transform: translateY(0) scale(1); }
.modal-content {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

/* ---- toasts -------------------------------------------------------------- */

.toast { border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }

/* ---- nav tabs (lead/campaign profile pages) ------------------------------ */

.nav-tabs { border-bottom: 1px solid var(--border); gap: .25rem; }
.nav-tabs .nav-link {
    border: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    color: var(--muted);
    font-weight: 600;
    padding: .55rem 1rem;
    position: relative;
    transition: color .2s var(--ease);
}
.nav-tabs .nav-link::after {
    content: '';
    position: absolute;
    left: .75rem; right: .75rem; bottom: -1px;
    height: 2px;
    background: var(--brand);
    transform: scaleX(0);
    transition: transform .25s var(--ease);
}
.nav-tabs .nav-link:hover { color: var(--brand); }
.nav-tabs .nav-link.active {
    color: var(--brand);
    background: transparent;
}
.nav-tabs .nav-link.active::after { transform: scaleX(1); }

/* ==========================================================================
   Sidebar - the "unique menu" treatment (section: layouts/app.php)
   ========================================================================== */

.co-sidebar {
    width: 252px;
    min-width: 252px;
    max-width: 252px;
    flex-shrink: 0;
    min-height: 100vh;
    background: radial-gradient(120% 140% at 0% 0%, #14275c 0%, #0a1730 55%, #070f24 100%);
    color: #c9d4ec;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}
.co-sidebar::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(63, 127, 224, .35), transparent 70%);
    pointer-events: none;
}

.co-brand {
    color: #fff;
    font-weight: 800;
    letter-spacing: .01em;
    display: flex;
    align-items: center;
    gap: .55rem;
}
.co-brand .mark {
    width: 34px; height: 34px;
    border-radius: .6rem;
    background: linear-gradient(135deg, var(--brand-2), #6ea8ff);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px -4px rgba(63, 127, 224, .55);
    animation: coPulseRing 2.6s ease-out infinite;
}

.co-nav-group {
    color: #6f80ac;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    padding: 1rem .9rem .35rem;
}

.co-nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: #c9d4ec;
    padding: .5rem .75rem;
    border-radius: .6rem;
    font-size: .89rem;
    text-decoration: none;
    position: relative;
    margin: 0 .35rem;
    transition: background-color .2s var(--ease), color .2s var(--ease), padding-left .2s var(--ease);
}
.co-nav-link .co-nav-icon {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    border-radius: .45rem;
    background: rgba(255, 255, 255, .06);
    font-size: .85rem;
    color: #a9b8dd;
    transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
    flex-shrink: 0;
}
.co-nav-link:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
    padding-left: 1rem;
}
.co-nav-link:hover .co-nav-icon { color: #fff; transform: translateY(-1px); }

.co-nav-link.active {
    background: linear-gradient(90deg, rgba(63, 127, 224, .28), rgba(63, 127, 224, .05));
    color: #fff;
}
.co-nav-link.active .co-nav-icon {
    background: var(--brand-2);
    color: #fff;
}
.co-nav-link.active::before {
    content: '';
    position: absolute;
    left: -.35rem; top: 18%; bottom: 18%;
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(180deg, #6ea8ff, var(--brand-2));
}

.co-sidebar-footer {
    color: #5d6d95;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

/* ---- topbar -------------------------------------------------------------- */

.co-topbar {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
}
.co-user-btn {
    border-radius: 999px !important;
    display: flex; align-items: center; gap: .5rem;
    padding: .3rem .75rem .3rem .3rem !important;
    transition: box-shadow .2s var(--ease);
}
.co-user-btn:hover { box-shadow: var(--shadow-sm); }
.co-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700;
}
.dropdown-menu { border-radius: var(--radius-sm); border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.dropdown-item { border-radius: .4rem; margin: .1rem .3rem; width: calc(100% - .6rem); transition: background-color .15s var(--ease); }

@media (max-width: 767.98px) {
    .co-sidebar { position: fixed; z-index: 1040; left: -252px; transition: left .25s var(--ease); }
    .co-sidebar.show { left: 0; box-shadow: var(--shadow-lg); }
}
