/* ================================================
   Koecall.ai — Reusable Component Styles
   Shared across all pages
   ================================================ */

/* ================================================
   Navbar Payoff
   ================================================ */
.navbar-payoff {
    font-size: 0.65rem;
    font-weight: 300;
    letter-spacing: 1px;
    opacity: 0.8;
    font-style: italic;
    text-transform: lowercase;
    margin-top: -5px;
}

/* ================================================
   Page Header (gradient banner)
   ================================================ */
.page-header {
    background: var(--koe-gradient);
    color: white;
    padding: var(--koe-space-xl);
    border-radius: var(--koe-radius-lg);
    margin-bottom: var(--koe-space-xl);
    box-shadow: var(--koe-shadow-coral);
}

.page-header h1 {
    margin: 0;
    font-weight: 700;
}

.page-header p {
    margin: var(--koe-space-sm) 0 0;
    opacity: 0.85;
}

/* ================================================
   Stat Cards
   ================================================ */
.stat-card {
    background: var(--koe-bg-card);
    border-radius: var(--koe-radius-lg);
    box-shadow: var(--koe-shadow-sm);
    border: none;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--koe-shadow-md);
}

.stat-card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.35rem 1.5rem 1.25rem;
}

.stat-card-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--koe-text);
    margin-bottom: 0.2rem;
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--koe-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--koe-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    color: white;
    flex-shrink: 0;
}

.stat-icon.primary { background: var(--koe-gradient); }
.stat-icon.success { background: linear-gradient(135deg, #28a745, #34ce57); }
.stat-icon.warning { background: linear-gradient(135deg, #ffc107, #ffdb4d); }
.stat-icon.info    { background: linear-gradient(135deg, #17a2b8, #1fc8e3); }
.stat-icon.danger  { background: linear-gradient(135deg, #dc3545, #ff6b6b); }

.stat-card-accent {
    height: 3px;
}
.stat-card-accent.primary { background: var(--koe-gradient); }
.stat-card-accent.success { background: linear-gradient(90deg, #28a745, #34ce57); }
.stat-card-accent.warning { background: linear-gradient(90deg, #ffc107, #ffdb4d); }
.stat-card-accent.info    { background: linear-gradient(90deg, #17a2b8, #1fc8e3); }
.stat-card-accent.danger  { background: linear-gradient(90deg, #dc3545, #ff6b6b); }

/* ================================================
   Content Cards
   ================================================ */
.content-card {
    background: var(--koe-bg-card);
    border-radius: var(--koe-radius-lg);
    box-shadow: var(--koe-shadow-sm);
    border: none;
    overflow: hidden;
}

.content-card .card-header,
.content-card-header {
    background: var(--koe-gradient);
    color: white;
    border: none;
    padding: var(--koe-space-md) var(--koe-space-lg);
    font-weight: 600;
}

.content-card .card-header h5,
.content-card-header h5 {
    margin: 0;
    font-weight: 600;
}

.content-card-body {
    padding: var(--koe-space-lg);
}

.content-card-header .btn-outline-light {
    border-color: rgba(255,255,255,.5);
    color: #fff;
    font-size: 0.85rem;
}

.content-card-header .btn-outline-light:hover {
    background: rgba(255,255,255,.15);
    border-color: #fff;
}

/* ================================================
   Empty State
   ================================================ */
.empty-state {
    text-align: center;
    padding: var(--koe-space-2xl) var(--koe-space-lg);
    color: var(--koe-text-muted);
}

.empty-state i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: var(--koe-space-md);
}

.empty-state h4 {
    color: var(--koe-text);
    margin-bottom: var(--koe-space-sm);
}

/* ================================================
   Badge Variants
   ================================================ */
.badge-trial    { background: #ffc107; color: #333; }
.badge-active   { background: #28a745; color: white; }
.badge-pending  { background: #17a2b8; color: white; }
.badge-expired  { background: #6c757d; color: white; }
.badge-pastdue  { background: #dc3545; color: white; }
.badge-cancelled { background: #6c757d; color: white; }

/* ================================================
   Info Tip
   ================================================ */
.info-tip {
    border-radius: var(--koe-radius-sm);
    border-left: 4px solid #17a2b8;
    background: #f0f9ff;
    padding: var(--koe-space-md);
}

/* ================================================
   Responsive
   ================================================ */
@media (max-width: 575.98px) {
    .page-header {
        padding: var(--koe-space-lg);
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-icon {
        width: 46px;
        height: 46px;
        font-size: 1.2rem;
    }
}

@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(255, 107, 107, 0.95);
        padding: var(--koe-space-md);
        margin-top: var(--koe-space-sm);
        border-radius: var(--koe-radius-sm);
    }
}

/* ================================================
   Print
   ================================================ */
@media print {
    .navbar, .footer, .btn, .toast-container { display: none !important; }
    .main-content { margin: 0; padding: 0; }
    body { padding-top: 0; }
}

/* ================================================
   Admin Tables (.koe-admin-table)
   ================================================ */
.koe-admin-table {
    width: 100%;
    font-size: .875rem;
}

.koe-admin-table thead th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--koe-text-muted);
    border-bottom: 2px solid #dee2e6;
    padding: .75rem 1rem;
    white-space: nowrap;
}

.koe-admin-table tbody td {
    vertical-align: middle;
    padding: .65rem 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.koe-admin-table tbody tr:last-child td {
    border-bottom: none;
}

.koe-admin-table tbody tr:hover {
    background-color: #fafafa;
}

.koe-admin-table .actions-cell {
    white-space: nowrap;
    text-align: right;
}

/* Sortable column headers */
.koe-admin-table th[data-sort] {
    cursor: pointer;
    user-select: none;
    transition: background .15s;
}

.koe-admin-table th[data-sort]:hover {
    background: #eef0f2;
}

/* ================================================
   Admin Filter Bar (.koe-filter-bar)
   ================================================ */
.koe-filter-bar {
    background: #fff;
    border-radius: var(--koe-radius-lg);
    box-shadow: var(--koe-shadow-sm);
    padding: .75rem 1rem;
    margin-bottom: 1rem;
}

/* Global .filter-btn active state — used across admin pages */
.filter-btn.active {
    background: var(--bs-primary);
    color: #fff;
    border-color: var(--bs-primary);
}

/* ================================================
   AI Assistant Form Components
   ================================================ */

/* Tag list (topics of interest / topics to avoid) */
.koe-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    min-height: 38px;
    padding: .35rem;
    border: 1px solid #dee2e6;
    border-radius: var(--koe-radius-sm);
    background: #fff;
}

.koe-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .82rem;
    cursor: default;
}

.koe-tag .tag-del {
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    font-size: .7em;
    opacity: .7;
    cursor: pointer;
    color: inherit;
}

.koe-tag .tag-del:hover { opacity: 1; }

/* Inline CRUD table (medications, emergency contacts) */
.koe-inline-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.koe-inline-table thead th {
    background: #f8f9fa;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--koe-text-muted);
    padding: .5rem .75rem;
    border-bottom: 1px solid #dee2e6;
}

.koe-inline-table tbody td {
    padding: .55rem .75rem;
    vertical-align: middle;
    border-bottom: 1px solid #f3f3f3;
    font-size: .875rem;
}

.koe-inline-table tbody tr:last-child td {
    border-bottom: none;
}

/* ─── Cookie Consent Banner ───────────────────────────────────────────── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px;
    z-index: 99999;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.3);
    animation: cookieSlideUp 0.5s ease-out;
}

@keyframes cookieSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.cookie-banner-text       { flex: 1; min-width: 300px; }
.cookie-banner-text h4    { margin: 0 0 10px; font-size: 1.2rem; }
.cookie-banner-text p     { margin: 0 0 10px; font-size: .9rem; line-height: 1.5; opacity: .9; }

.cookie-link              { color: #FF8E53; text-decoration: underline; }
.cookie-link:hover        { color: #FFB88C; }

.cookie-banner-actions    { display: flex; flex-wrap: wrap; gap: 10px; }

.btn-cookie               { padding: 12px 24px; border: none; border-radius: 25px; font-weight: 600; cursor: pointer; transition: all .3s ease; font-size: .9rem; }
.btn-cookie-accept        { background: linear-gradient(135deg, #FF6B35 0%, #FF8E53 100%); color: #fff; }
.btn-cookie-accept:hover  { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(255,107,53,.4); }
.btn-cookie-reject        { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.5); }
.btn-cookie-reject:hover  { background: rgba(255,255,255,.1); border-color: #fff; }
.btn-cookie-settings      { background: rgba(255,255,255,.1); color: #fff; border: 2px solid rgba(255,255,255,.3); }
.btn-cookie-settings:hover{ background: rgba(255,255,255,.2); }
.btn-cookie-save          { background: #28a745; color: #fff; }
.btn-cookie-save:hover    { background: #218838; }

/* ─── Cookie Preferences Modal ────────────────────────────────────────── */
.cookie-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 100000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: cookieFadeIn .3s ease-out;
}
@keyframes cookieFadeIn { from { opacity: 0; } to { opacity: 1; } }

.cookie-modal-content {
    background: #fff; border-radius: 15px;
    max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    animation: cookieScaleIn .3s ease-out;
}
@keyframes cookieScaleIn { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.cookie-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8E53 100%);
    color: #fff; border-radius: 15px 15px 0 0;
}
.cookie-modal-header h3     { margin: 0; font-size: 1.3rem; }
.cookie-modal-close          { background: none; border: none; color: #fff; font-size: 1.8rem; cursor: pointer; opacity: .8; transition: opacity .2s; }
.cookie-modal-close:hover    { opacity: 1; }
.cookie-modal-body           { padding: 25px; }
.cookie-modal-footer         { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding: 20px 25px; border-top: 1px solid #eee; background: #f8f9fa; border-radius: 0 0 15px 15px; }

/* ─── Cookie categories & toggles ─────────────────────────────────────── */
.cookie-category             { background: #f8f9fa; border-radius: 10px; padding: 20px; margin-bottom: 15px; }
.cookie-category-header      { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cookie-category-info        { display: flex; align-items: center; gap: 10px; }
.cookie-category-info h5     { margin: 0; font-size: 1rem; }
.cookie-category-desc        { margin: 0; font-size: .85rem; color: #666; line-height: 1.5; }

.cookie-badge                { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.cookie-badge-necessary      { background: #d4edda; color: #155724; }
.cookie-badge-preferences    { background: #cce5ff; color: #004085; }
.cookie-badge-analytics      { background: #fff3cd; color: #856404; }

.toggle-switch               { position: relative; display: inline-block; width: 50px; height: 26px; }
.toggle-switch input         { opacity: 0; width: 0; height: 0; }
.toggle-slider               { position: absolute; cursor: pointer; inset: 0; background: #ccc; transition: .3s; border-radius: 26px; }
.toggle-slider::before       { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background: #fff; transition: .3s; border-radius: 50%; }
.toggle-switch input:checked + .toggle-slider            { background: linear-gradient(135deg, #FF6B35 0%, #FF8E53 100%); }
.toggle-switch input:checked + .toggle-slider::before    { transform: translateX(24px); }
.cookie-toggle-disabled      { font-size: .75rem; color: #28a745; font-weight: 600; }

@media (max-width: 768px) {
    .cookie-banner-content   { flex-direction: column; text-align: center; }
    .cookie-banner-actions   { justify-content: center; width: 100%; }
    .btn-cookie              { padding: 10px 18px; font-size: .85rem; }
    .cookie-modal-footer     { justify-content: center; }
}
