/* Revised Horizontal Filter Button Styles - Using ID for Specificity */
/* Active state for "All" button */
#filter-btn-all.filter-button-active,
#filter-btn-all.filter-button-active:focus,
#filter-btn-all.filter-button-active:hover {
    background-color: var(--violet-50) !important; /* Explicit background */
    color: var(--violet-700) !important; /* Explicit text color */
    border-color: var(--violet-200) !important; /* Explicit border color */
    box-shadow: none !important; /* Remove default focus shadows */
    opacity: 1 !important; /* Ensure full opacity */
    font-weight: 600 !important; /* ← Add this line */
}

/* Active state for "Flagged" button */
#filter-btn-flagged.filter-button-active,
#filter-btn-flagged.filter-button-active:focus,
#filter-btn-flagged.filter-button-active:hover {
    background-color: var(--violet-50) !important; /* Explicit background */
    color: var(--violet-700) !important; /* Explicit text color */
    border-color: var(--violet-200) !important; /* Explicit border color */
    box-shadow: none !important; /* Remove default focus shadows */
    opacity: 1 !important; /* Ensure full opacity */
    font-weight: 600 !important; /* ← Add this line */
}

.horizontal-filter-buttons .btn {
    font-weight: 400; /* Normal weight for inactive buttons */
}

/* Ensure default btn-outline-secondary styles are not interfering when not active */
.horizontal-filter-buttons .btn.btn-outline-secondary:not(.filter-button-active):hover {
    background-color: var(--gray-100); /* Or var(--violet-100) for a subtle violet hover */
    border-color: var(--violet-200) !important; /* Keep border same color as default state */
}
/*
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,900;1,400;1,500;1,900&display=swap');
*/
:root {
    /* Colors */
    --primary-color: #1d2d35;
   /* --secondary-color: #2d9cdb;*/
   --secondary-color: #476482;
  /*  --background-color: #f8f9fa; */
    --background-color: #faf9f9;
    --text-color: #374151;
    --accent-purple: #41153d;
    --accent-blue: #476482;
    --accent-orange: #ea7f3d;
}

.bg-accent-orange {
    background-color: var(--amber-500) !important;
}

/* Custom background colors for badges */
.bg-violet {
    background-color: var(--violet-700) !important;
    color: #fff !important;
}

.bg-info {
    background-color: var(--teal-500) !important;
    color: white !important;
} 

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    font-size: 0.9rem;
}

/*
h1, h2, h3 {
    font-weight: 700 !important;
    font-family: 'Inter', sans-serif !important;
    color: var(--secondary-color) !important;
    font-style: italic;
}
*/

h1, h2, h3 {
    font-family: 'Quicksand', sans-serif !important;
    font-weight: 600 !important; /* Semi-bold for headlines */
    color: var(--secondary-color) !important;
}

/* Styled card titles - matches table header styling */
h4.styled-card-title {
    font-weight: 600 !important;
    color: var(--violet-800) !important;
    font-family: var(--font-heading) !important;
    font-size: 1.1rem;
}

.navbar {
    /* Remove any background-color that might conflict with our gradient */
    background-color: transparent;
}

/* Align navbar container with content below */
.navbar .container {
    max-width: 1000px;
    padding-left: 1rem; /* Reduced from 2rem to give more space to nav items */
    padding-right: 1rem;
}

.navbar-nav .nav-link {
    /* Remove any font-family that might conflict with our Quicksand font */
    font-family: var(--font-heading) !important;
    color: var(--violet-800) !important;
    font-weight: 600 !important;
    font-size: 1.0rem !important; /* Was 1.1rem, reducing to save space */
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .navbar-nav .nav-link {
        font-size: 1rem;
    }
}

/* Navbar logo styling */
.chumzee-logo {
    height: 34px; /* Reduced by ~25% from 45px */
    width: auto;
    transition: height 0.3s ease; /* Smooth transition when size changes */
}

/* Responsive styling for smaller screens */
@media (max-width: 768px) {
    .chumzee-logo {
        height: 26px; /* Reduced by ~25% from 35px */
    }
}

.container {
    max-width: 1000px;
    padding: 2rem 1rem;
}

.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 8px;
    background-color: white;
    margin-bottom: 1.5rem;
}

.btn-primary {
    background-color: var(--secondary-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.btn-primary:hover {
    background-color: #2486c0;
}

.form-control {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.75rem;
}

.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(45, 156, 219, 0.2);
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: #e5e7eb;
    color: var(--text-color);
}

.flash-message {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 6px;
    background-color: #f3f4f6;
}

.flash-message.success {
    background-color: #d1fae5;
    color: #065f46;
}

.flash-message.error {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Flash Messages */
.alert {
    border: none;
    border-radius: 8px;
    margin: 1rem 0;
    padding: 1rem;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border-left: 4px solid #198754;
}

.alert-error, .alert-danger {
    background-color: #f8d7da;
    color: #842029;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background-color: #cff4fc;
    color: #055160;
    border-left: 4px solid #0dcaf0;
}

/* Animation for alerts */
.alert.fade {
    transition: opacity 0.15s linear;
}

.alert.fade.show {
    opacity: 1;
}

.alert.fade:not(.show) {
    opacity: 0;
}

/* Position alerts at the top of the page */
.container-fluid > .alert:first-child {
    margin-top: 1.5rem;
}

/* Close button styling */
.alert .btn-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.5rem;
    opacity: 0.5;
}

.alert .btn-close:hover {
    opacity: 1;
}

/* Target all Bootstrap tables in the contacts section */
.contacts-table th {
    font-weight: 700 !important;
    color: var(--secondary-color) !important;
/*    font-style: italic;*/
/*    font-family: 'Inter', sans-serif; */
    font-family: 'Quicksand', sans-serif !important;
    font-size: 1.1rem;
}

/* Modal title styling to match table headers */
.styled-modal-title {
    font-weight: 600;
    color: var(--violet-800);
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

/* Modal header with gradient */
.modal-header-gradient {
    background: linear-gradient(to right, var(--violet-100), var(--fuchsia-100));
    border-bottom: 1px solid var(--violet-200);
}

/* Contacts table name */
.contact-names {
    color: var(--text-dark);
    font-weight: 500;
}

.contact-email {
    color: var(--text-medium);
    font-size: 0.8rem;
}

/* Add Interaction Button Styling */

button[hx-get*="add_interaction"] {
    background: transparent; 
}

button[hx-get*="add_interaction"]:hover {
    transform: scale(1.2);
    /* background-color: var(--violet-50); 
    border-radius: 0.25rem; */
}




/* 
 * Table Header Rounded Corners Fix
 * 
 * This CSS addresses an issue with the contacts table header where the top corners weren't properly rounded.
 * The problem occurs because:
 * 1. In theme.css, there are styles for .table thead tr th:first/last-child with border-radius
 * 2. However, these styles don't work properly because tables need border-collapse: separate for border-radius to work
 * 3. Additionally, we need to handle overflow properly to ensure the rounded corners are visible
 * 
 * These styles override the theme.css settings by:
 * - Setting border-collapse: separate (crucial for table border-radius to work)
 * - Adding overflow handling to prevent content from covering rounded corners
 * - Using !important to ensure our styles take precedence over theme.css
 */
/* Fix for rounded corners on contacts table header */
.contacts-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.contacts-table thead {
    overflow: hidden !important;
}

.contacts-table thead tr {
    border-radius: 0.75rem 0.75rem 0 0 !important;
    overflow: hidden !important;
}

.contacts-table thead tr th:first-child {
    border-top-left-radius: 0.75rem !important;
}

.contacts-table thead tr th:last-child {
    border-top-right-radius: 0.75rem !important;
}

.contact-name-link {
  transition: color 0.2s ease;
  color: inherit;
  text-decoration: none;
}

.contact-name-link:hover {
/*  text-decoration: underline !important; */
  color: var(--violet-600, #7c3aed) !important;
}

/* Style for email links */
a.contact-email {
  transition: color 0.2s ease;
  color: var(--text-medium);
  font-size: 0.8rem;
  text-decoration: none;
}

a.contact-email:hover {
  color: var(--violet-600, #7c3aed) !important;
}

/* Interactive Relationship Strength Selector */
.relationship-strength-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.strength-dots {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    height: 2rem;
}

.strength-dot {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--gray-200);
    opacity: 0.4;
    transform: scale(0.8);
    border: 1px solid var(--gray-500); /* Added border for better visibility */
}

.strength-dot:hover {
    transform: scale(1);
    opacity: 0.7;
}

.strength-dot.active {
    transform: scale(1);
    opacity: 1;
    border: none; /* Remove border when dot is active */
}

.strength-dot.hover {
    transform: scale(1);
    opacity: 0.8;
    border: none; /* Remove border when dot is hovered */
}

.strength-dot.level-1.active, .strength-dot.level-1.hover {
    background-color: var(--violet-200);
    border: none; /* Ensure border is removed for active/hover state */
}

.strength-dot.level-2.active, .strength-dot.level-2.hover {
    background-color: var(--violet-400);
    border: none; /* Ensure border is removed for active/hover state */
}

.strength-dot.level-3.active, .strength-dot.level-3.hover {
    background-color: var(--violet-600);
    border: none; /* Ensure border is removed for active/hover state */
}

.strength-dot.level-4.active, .strength-dot.level-4.hover {
    background-color: var(--violet-800);
    border: none; /* Ensure border is removed for active/hover state */
}

.strength-label {
    font-size: 1rem;
    color: var(--text-medium-dark);
    font-weight: 400;
    min-width: 140px;
    margin-left: 0.5rem;
}

/* Custom SVG icon styling for navbar */
.nav-icon-svg {
    width: 1em;   /* Scales with the parent link's font size */
    height: 1em;  /* Scales with the parent link's font size */
    vertical-align: -0.125em; /* Aligns similarly to Bootstrap icons */
    /* The 'fill' will be 'currentColor', inherited from the 'a.nav-link' color */
}

/* =================================================================
   Pagination Custom Styling - FIXED: Purple Halo Focus Issue
   ================================================================= */
/* 
 * BUGFIX (2025-01): Resolved issue where pagination buttons would retain
 * a purple halo and darker fill color after being clicked with mouse.
 * 
 * SOLUTION: Replaced :focus with :focus-visible to only show focus styling
 * during keyboard navigation, not mouse clicks. This follows modern web
 * accessibility standards and provides better UX.
 * 
 * COMPATIBILITY: :focus-visible is supported in 95%+ of browsers (all modern browsers).
 * Fallback behavior in older browsers is the original focus styling.
 * 
 * FOR FUTURE AI AGENTS: If users report focus issues, check:
 * 1. Browser support for :focus-visible (caniuse.com)
 * 2. Whether Alpine.js click handlers are interfering with focus
 * 3. If new pagination components need similar treatment
 */

/* Default state for pagination links */
.pagination .page-item .page-link {
    color: var(--violet-700);
    border-color: var(--violet-200);
    font-family: var(--font-heading);
    font-weight: 600;
    transition: all 0.2s ease; /* TEST: Disabled to check for conflict with Alpine.js reactivity */
}

/* Hover state for pagination links */
.pagination .page-item .page-link:hover {
    background-color: var(--violet-50);
    color: var(--violet-800);
}

/* Active state (current page) */
.pagination .page-item.active .page-link {
    background-color: var(--violet-700);
    border-color: var(--violet-700);
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 3; /* Ensures the active link is visually on top */
}

/* Disabled state (e.g., "Previous" on page 1) */
.pagination .page-item.disabled .page-link {
    color: var(--gray-400);
    background-color: var(--gray-100);
    border-color: var(--violet-100);
    pointer-events: none; /* Prevents clicks on disabled items */
}

/* 
 * KEYBOARD NAVIGATION FOCUS STYLING
 * ================================
 * Uses :focus-visible instead of :focus to only show focus ring during
 * keyboard navigation (Tab key), not mouse clicks. This prevents the
 * "stuck purple halo" issue while maintaining accessibility.
 * 
 * IMPORTANT: We need to override Bootstrap's .page-link:focus rule directly
 * because Bootstrap's selector is simpler and more specific.
 */

/* Override Bootstrap's focus styling completely */
.page-link:focus {
    outline: none !important;
    box-shadow: none !important;
    background-color: inherit !important;
    color: inherit !important;
}

/* Only show focus ring during keyboard navigation */
.page-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2) !important;
    z-index: 2;
}

/* 
 * FALLBACK FOR OLDER BROWSERS
 * ===========================
 * Provides basic focus styling for browsers that don't support :focus-visible.
 * This ensures accessibility is maintained even in older browsers.
 */
@supports not selector(:focus-visible) {
    .page-link:focus {
        outline: 2px solid rgba(139, 92, 246, 0.3) !important;
        outline-offset: 2px;
        box-shadow: none !important;
    }
}

/* 
 * FINAL FIX: Winning the CSS Specificity War
 * ============================================
 * This is the crucial rule that fixes the "purple fill doesn't appear" bug on pagination controls in bottom of page.
 *
 * THE PROBLEM: When a user clicks a page link, that link becomes BOTH `active`
 * (because Alpine.js adds the class to its parent `<li>`) and `:focus` (a
 * standard browser behavior on click). This created a "specificity war" between
 * two rules:
 *   1. `.page-item.active .page-link`  (our rule for the purple fill)
 *   2. `.page-link:focus`               (our rule to hide the ugly focus ring)
 *
 * The `.page-link:focus` rule included `background-color: inherit !important`,
 * which was overriding the purple fill from the active state rule. The purple
 * fill would only appear after the user clicked away, removing the `:focus` state.
 *
 * THE SOLUTION: This new, more specific selector targets a link that is BOTH
 * inside an `.active` item AND is in a `:focus` state. By re-asserting the
 * active styles here (background, color, border) with `!important`, we ensure
 * it wins the war and the active styles are always visible, while still
 * successfully hiding the default browser focus ring via `box-shadow: none`.
 */
.pagination .page-item.active .page-link:focus,
.pagination .page-item.active .page-link:focus-visible {
    /* Re-assert the active styles to win the specificity war against the general :focus rule */
    background-color: var(--violet-700) !important;
    color: white !important;
    border-color: var(--violet-700) !important;
    box-shadow: none !important; /* Also keep the original purpose: remove the focus ring */
    outline: none !important;
}

.pagination .page-item.disabled .page-link:focus,
.pagination .page-item.disabled .page-link:focus-visible {
    box-shadow: none !important;
    outline: none !important;
}

/* 
 * PAGINATION SUMMARY CONTROLS (Top Navigation Arrows)
 * ==================================================
 * Apply the same focus-visible fix to the top pagination controls
 * to prevent purple halo on the chevron left/right buttons
 */
.btn.btn-outline-secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

/* Fallback for older browsers - applies to pagination summary buttons */
@supports not selector(:focus-visible) {
    .btn.btn-outline-secondary:focus {
        outline: 2px solid rgba(139, 92, 246, 0.3);
        outline-offset: 2px;
        box-shadow: none;
    }
}

/* Ensure disabled pagination summary buttons don't show focus styling */
.btn.btn-outline-secondary:disabled:focus,
.btn.btn-outline-secondary:disabled:focus-visible {
    box-shadow: none;
    outline: none;
}
