﻿/* ============================================
   ADDRESS BOOK CORE - REUSABLE MODULE
   Version: 2.0.0
   Description: Core component styles for address book module
   Author: Enterprise Development Team
   Last Modified: 2024
   ============================================ */

/* ============================================
   TABLE OF CONTENTS
   ============================================
   1. Module Scope & Container
   2. View Controls
   3. Contact Cards
      3.1 Grid Layout
      3.2 Card Design
      3.3 Card Components
   4. Alphabetical View
      4.1 Container & Navigation
      4.2 Contact Items
   5. Context Menu
   6. Matter & Note Components
   7. Activity Timeline
   8. Status Badges
   9. Responsive Design
   10. Accessibility Support
   ============================================ */

/* ============================================
   1. MODULE SCOPE & CONTAINER
   ============================================ */

.addressbook-scope,
.addressbook-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================
   2. VIEW CONTROLS
   ============================================ */

.view-toggle {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    color: #6c757d;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

    .view-toggle-btn:hover {
        background-color: #f8f9fa;
        border-color: #adb5bd;
    }

    .view-toggle-btn.active {
        background-color: #007AFF;
        border-color: #007AFF;
        color: white;
    }

/* ============================================
   3. CONTACT CARDS
   ============================================ */

/* 3.1 Grid Layout */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

/* 3.2 Card Design */
.contact-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

    .contact-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        border-color: #007AFF;
        transform: translateY(-1px);
    }

    .contact-card:focus {
        outline: 2px solid #007AFF;
        outline-offset: -2px;
    }

/* 3.3 Card Components */
.contact-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 1rem;
}

.contact-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.contact-info {
    min-width: 0;
    flex: 1;
}

.contact-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1rem;
}

.contact-type {
    font-size: 0.8125rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    font-weight: 500;
}

.contact-staff-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    vertical-align: middle;
    white-space: nowrap;
}

    .contact-staff-badge i {
        font-size: 0.75rem;
    }

/* Ensure badge doesn't break layout on small screens */
@media (max-width: 768px) {
    .contact-staff-badge {
        font-size: 0.625rem;
        padding: 0.0625rem 0.375rem;
        gap: 0.125rem;
    }

        .contact-staff-badge i {
            font-size: 0.6875rem;
        }
}

/* Staff badge for alphabetical view (icon only for space) */
.contact-staff-badge-alpha {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.375rem;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    color: white;
    font-size: 0.6875rem;
    border-radius: 3px;
    vertical-align: middle;
}

    .contact-staff-badge-alpha i {
        font-size: 0.6875rem;
    }

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.contact-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    min-height: 20px;
}

    .contact-detail i {
        font-size: 0.875rem;
        color: #6c757d;
        width: 16px;
        flex-shrink: 0;
    }

    .contact-detail a {
        color: #007AFF;
        text-decoration: none;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

        .contact-detail a:hover {
            text-decoration: underline;
        }

.contact-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}

.contact-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.contact-card:hover .contact-actions {
    opacity: 1;
}

.action-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease;
    color: #6c757d;
}

    .action-btn:hover {
        background-color: #f8f9fa;
        color: #495057;
    }

.badges-container {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.matter-count,
.note-count {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
}

    .matter-count i,
    .note-count i {
        font-size: 0.875rem;
    }

.audit-indicator {
    font-size: 0.875rem;
    color: #6c757d;
    cursor: help;
}

/* ============================================
   4. ALPHABETICAL VIEW
   ============================================ */

/* 4.1 Container & Navigation */

/* Alpha Container - Flex layout for side-by-side content + nav */
.alpha-container {
    display: none;
    position: relative;
    height: 100%;
    width: 100%;
}

    .alpha-container.active {
        display: flex;
        flex-direction: row;
        gap: 0; /* No gap, nav will overlap with position */
    }

/* Alpha Content - Scrollable area */
.alpha-content {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    padding-right: 80px; /* Space for sticky navigation */
    padding-bottom: 0; /* ✅ Remove - let parent handle it */
    /* Smooth scrolling for better UX */
    scroll-behavior: smooth;
    /* Hardware acceleration */
    transform: translateZ(0);
    -webkit-overflow-scrolling: touch;
}

/* A-Z Navigation - STICKY with dynamic centering */
.alpha-nav {
    /* Sticky Positioning - stays in place during scroll */
    position: sticky;
    top: 0;
    right: 0;
    /* Positioning within parent */
    align-self: flex-start; /* Start at top of container */
    margin-left: auto; /* Push to right side */
    margin-right: 24px;
    /* Dynamic vertical centering - MORE CONSERVATIVE */
    margin-top: max(20px, calc(50vh - 360px));
    margin-bottom: max(20px, 5vh); /* ✅ ADDED: Explicit bottom margin */
    /* Layout */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 10px 6px;
    /* Sizing - REDUCED for safety */
    width: 48px;
    max-height: min(720px, calc(90vh - 220px)); /* ✅ FIXED: More conservative height */
    /* Modern Glass Morphism Design */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    /* Border & Shadow */
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    /* Layering */
    z-index: 100;
    /* Smooth transitions */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Prevent text selection */
    user-select: none;
    -webkit-user-select: none;
    /* Hardware acceleration */
    will-change: transform, opacity;
    /* Ensure it doesn't overflow - CRITICAL */
    overflow-y: auto;
    overflow-x: hidden;
    /* Hide scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

    /* Hide scrollbar for Chrome/Safari */
    .alpha-nav::-webkit-scrollbar {
        display: none;
    }

    /* Hover effect on entire nav */
    .alpha-nav:hover {
        box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
        border-color: rgba(0, 122, 255, 0.2);
    }

/* Individual Letter Buttons */
.alpha-nav-letter {
    /* Sizing */
    width: 36px;
    height: 28px;
    /* Layout */
    display: flex;
    align-items: center;
    justify-content: center;
    /* Typography */
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1;
    /* Colors */
    color: #6c757d;
    background: transparent;
    /* Shape */
    border-radius: 6px;
    border: 1px solid transparent;
    /* Interaction */
    cursor: pointer;
    /* Smooth transitions */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    /* Prevent layout shift */
    flex-shrink: 0;
}

    /* Hover State - Active letters only */
    .alpha-nav-letter:not(.disabled):hover {
        background: linear-gradient(135deg, #E7F1FF 0%, #F0F8FF 100%);
        color: #007AFF;
        border-color: rgba(0, 122, 255, 0.2);
        transform: scale(1.08);
        box-shadow: 0 2px 8px rgba(0, 122, 255, 0.15);
    }

    /* Active State - Currently viewing section */
    .alpha-nav-letter.active {
        background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
        color: white;
        border-color: transparent;
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4), 0 2px 4px rgba(0, 122, 255, 0.3);
        font-weight: 800;
    }

    /* Disabled State - No contacts for this letter */
    .alpha-nav-letter.disabled {
        color: #dee2e6;
        cursor: not-allowed;
        opacity: 0.4;
        pointer-events: none;
    }

    /* Focus State - Keyboard navigation */
    .alpha-nav-letter:focus-visible {
        outline: 2px solid #007AFF;
        outline-offset: 2px;
        border-color: #007AFF;
    }

    /* Active (pressed) state */
    .alpha-nav-letter:not(.disabled):active {
        transform: scale(1.02);
        transition-duration: 0.1s;
    }

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .alpha-nav {
        background: rgba(28, 28, 30, 0.85);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .alpha-nav-letter {
        color: #98989d;
    }

        .alpha-nav-letter:not(.disabled):hover {
            background: rgba(255, 255, 255, 0.1);
            color: #0A84FF;
            border-color: rgba(10, 132, 255, 0.3);
        }

        .alpha-nav-letter.active {
            background: linear-gradient(135deg, #0A84FF 0%, #0066CC 100%);
        }

        .alpha-nav-letter.disabled {
            color: #3a3a3c;
        }
}

/* ============================================
   4.2 Alpha Contact Items & Sections
   ============================================ */

/* Alpha Section - Letter groupings */
.alpha-section {
    margin-bottom: 2.5rem;
    scroll-margin-top: 20px; /* Offset for smooth scroll */
}

/* Section Letter Header - Sticky within scroll container */
.alpha-letter {
    /* Typography */
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #007AFF;
    /* Spacing */
    margin-bottom: 1rem;
    padding: 0.75rem 0;
    /* Visual */
    border-bottom: 3px solid #007AFF;
    background: linear-gradient(to bottom, white 0%, white 80%, rgba(0, 122, 255, 0.03) 100%);
    /* Sticky positioning */
    position: sticky;
    top: 0;
    z-index: 10;
    /* Prevent background bleed */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Alpha Contact Item */
.alpha-contact-item {
    /* Layout */
    display: flex;
    align-items: center;
    gap: 1rem;
    /* Spacing */
    padding: 0.875rem 1rem;
    margin-bottom: 2px;
    /* Visual */
    background: white;
    border: 1px solid transparent;
    border-radius: 10px;
    /* Interaction */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    /* Performance */
    will-change: transform, box-shadow;
}

    /* Hover State */
    .alpha-contact-item:hover {
        background: linear-gradient(135deg, #F8F9FA 0%, #FFFFFF 100%);
        border-color: #E9ECEF;
        transform: translateX(4px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
    }

    /* Focus State */
    .alpha-contact-item:focus-visible {
        outline: 2px solid #007AFF;
        outline-offset: 2px;
        border-color: #007AFF;
    }

    /* Active (pressed) State */
    .alpha-contact-item:active {
        transform: translateX(2px) scale(0.995);
        transition-duration: 0.1s;
    }

/* Alpha Avatar */
.alpha-contact-avatar {
    /* Sizing */
    width: 40px;
    height: 40px;
    /* Layout */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* Typography */
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: white;
    /* Visual */
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
    /* Performance */
    will-change: transform;
}

/* Avatar grows on item hover */
.alpha-contact-item:hover .alpha-contact-avatar {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.35);
}

/* Contact Info Container */
.alpha-contact-info {
    flex: 1;
    min-width: 0; /* Allows text truncation */
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Contact Name */
.alpha-contact-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #212529;
    line-height: 1.3;
    /* Text overflow handling */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Contact Details Row */
.alpha-contact-details {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    font-size: 0.8125rem;
    color: #6c757d;
    line-height: 1.2;
}

    .alpha-contact-details span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* Contact Type Badge */
.alpha-contact-type {
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    font-size: 0.6875rem;
}

/* Badges Container */
.alpha-badges {
    display: flex;
    gap: 0.625rem;
    align-items: center;
    flex-shrink: 0;
}

/* Matter & Note Count Badges */
.alpha-contact-matters,
.alpha-contact-notes {
    display: flex;
    align-items: center;
    gap: 0.3125rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #6c757d;
    background: #F8F9FA;
    border: 1px solid #E9ECEF;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.alpha-contact-item:hover .alpha-contact-matters,
.alpha-contact-item:hover .alpha-contact-notes {
    background: white;
    border-color: #DEE2E6;
    color: #495057;
}

.alpha-contact-matters i,
.alpha-contact-notes i {
    font-size: 0.75rem;
}

/* ============================================
   4.3 Responsive A-Z Navigation
   ============================================ */

/* Large viewports - More vertical padding */
@media (min-height: 900px) {
    .alpha-nav {
        margin-top: calc(50vh - 360px);
        margin-bottom: 5vh;
        max-height: 720px;
    }
}

/* Tablets - Adjust positioning */
@media (max-width: 1024px) {
    .alpha-nav {
        margin-right: 16px;
        margin-top: max(16px, calc(50vh - 320px));
        margin-bottom: max(16px, 4vh);
        max-height: calc(88vh - 200px);
    }

    .alpha-content {
        padding-right: 70px;
    }
}

/* Small Tablets - Reduce size */
@media (max-width: 768px) {
    .alpha-nav {
        margin-right: 12px;
        margin-top: max(12px, calc(50vh - 280px));
        margin-bottom: max(12px, 3vh);
        width: 40px;
        padding: 8px 4px;
        gap: 1px;
        max-height: calc(86vh - 180px);
    }

    .alpha-nav-letter {
        width: 30px;
        height: 24px;
        font-size: 10px;
    }

    .alpha-content {
        padding-right: 60px;
        padding-left: 1rem;
    }

    .alpha-letter {
        font-size: 1.5rem;
    }

    .alpha-contact-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
}

/* Mobile - Smaller nav */
@media (max-width: 480px) {
    .alpha-nav {
        margin-right: 8px;
        margin-top: max(10px, calc(50vh - 240px));
        margin-bottom: max(10px, 3vh);
        width: 36px;
        padding: 6px 3px;
        max-height: calc(84vh - 160px);
    }

    .alpha-nav-letter {
        width: 28px;
        height: 22px;
        font-size: 9px;
        gap: 1px;
    }

    .alpha-content {
        padding: 1rem;
        padding-right: 50px;
    }
}

/* Short viewports - Reduce spacing */
@media (max-height: 700px) {
    .alpha-nav {
        margin-top: 10px;
        margin-bottom: 10px;
        max-height: calc(100vh - 140px);
        gap: 1px;
    }

    .alpha-nav-letter {
        height: 24px;
    }
}

/* Very short viewports */
@media (max-height: 500px) {
    .alpha-nav {
        margin-top: 8px;
        margin-bottom: 8px;
        max-height: calc(100vh - 120px);
        gap: 0;
        padding: 6px 4px;
    }

    .alpha-nav-letter {
        height: 20px;
        font-size: 9px;
    }
}

/* Very small screens - Consider hiding alphabet nav */
@media (max-width: 360px) {
    .alpha-nav {
        display: none;
    }

    .alpha-content {
        padding: 1rem;
    }
}
/* ============================================
   4.4 Accessibility & Motion
   ============================================ */

/* High contrast mode support */
@media (prefers-contrast: high) {
    .alpha-nav {
        border: 2px solid currentColor;
        background: white;
    }

    .alpha-nav-letter.active {
        outline: 2px solid white;
        outline-offset: -4px;
    }

    .alpha-contact-item:hover {
        outline: 2px solid currentColor;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .alpha-content {
        scroll-behavior: auto;
    }

    .alpha-nav,
    .alpha-nav-letter,
    .alpha-contact-item,
    .alpha-contact-avatar {
        transition: none !important;
        transform: none !important;
    }

        .alpha-nav-letter:not(.disabled):hover,
        .alpha-contact-item:hover {
            transform: none !important;
        }
}

/* Print styles */
@media print {
    .alpha-nav {
        display: none;
    }

    .alpha-content {
        padding-right: 1rem;
    }
}

/* ============================================
   5. CONTEXT MENU
   ============================================ */

.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    min-width: 180px;
    z-index: 1050;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.15s ease;
    pointer-events: none;
}

    .context-menu.show {
        opacity: 1;
        transform: scale(1);
        pointer-events: auto;
    }

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #212529;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

    .context-menu-item:hover {
        background-color: #f8f9fa;
    }

    .context-menu-item.danger {
        color: #dc3545;
    }

        .context-menu-item.danger:hover {
            background-color: #f8d7da;
        }

    .context-menu-item i {
        font-size: 1rem;
        width: 16px;
    }

.context-menu-divider {
    height: 1px;
    background-color: #dee2e6;
    margin: 0.5rem 0;
}

/* ============================================
   6. MATTER & NOTE COMPONENTS
   ============================================ */

/* Matter Items */
.matter-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

    .matter-item:hover {
        border-color: #007AFF;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

.matter-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.matter-info {
    flex: 1;
}

.matter-title {
    font-weight: 600;
    color: #212529;
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 4px;
}

.matter-number {
    font-size: 12px;
    color: #6c757d;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.matter-role {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
    font-style: italic;
}

.matter-status {
    flex-shrink: 0;
}

/* Note Items */
.note-item {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    border-left: 3px solid #007AFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.note-date {
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
}

.note-author {
    font-size: 11px;
    color: #6c757d;
}

.note-content {
    font-size: 13px;
    color: #495057;
    line-height: 1.4;
}

/* No Content State */
.no-content {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
}

    .no-content i {
        font-size: 32px;
        margin-bottom: 12px;
        display: block;
        color: #dee2e6;
    }

/* ============================================
   7. ACTIVITY TIMELINE
   ============================================ */

.timeline-item {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    position: relative;
}

.timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #5AC8FA;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.timeline-content {
    flex: 1;
}

.timeline-action {
    font-weight: 600;
    color: #212529;
    font-size: 13px;
}

.timeline-user {
    font-size: 12px;
    color: #6c757d;
}

.timeline-timestamp {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
    display: block;
}

/* ============================================
   8. STATUS BADGES
   ============================================ */

.status-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-active,
.status-open {
    background: rgba(52, 199, 89, 0.15);
    color: #34C759;
}

.status-pending,
.status-on-hold {
    background: rgba(255, 149, 0, 0.15);
    color: #FF9500;
}

.status-closed,
.status-inactive {
    background: rgba(173, 181, 189, 0.15);
    color: #6c757d;
}

/* ============================================
   10. RESPONSIVE DESIGN
   ============================================ */

/* Large Tablets */
@media (max-width: 1200px) {
    .contacts-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.25rem;
        padding: 1.25rem;
    }

    .contact-card {
        padding: 1rem;
    }
}

/* Small Tablets */
@media (max-width: 768px) {
    .contacts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .alpha-nav {
        width: 36px;
    }

    .alpha-nav-letter {
        width: 24px;
        height: 24px;
        font-size: 0.6875rem;
    }

    .view-toggle {
        order: -1;
        margin-bottom: 0.5rem;
    }
}

/* Mobile Devices */
@media (max-width: 480px) {
    .contact-header {
        gap: 0.75rem;
    }

    .contact-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }

    .contact-name {
        font-size: 0.9375rem;
    }

    .contact-details {
        gap: 0.375rem;
    }

    .contact-detail {
        font-size: 0.8125rem;
    }

    .alpha-contact-item {
        gap: 0.75rem;
        padding: 0.625rem;
    }

    .alpha-contact-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .alpha-contact-name {
        font-size: 0.875rem;
    }

    .alpha-contact-details {
        font-size: 0.75rem;
    }
}

/* ============================================
   11. ACCESSIBILITY SUPPORT
   ============================================ */

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .contact-card:hover {
        background-color: #000;
        color: #fff;
    }

    .alpha-contact-item:hover {
        background-color: #000;
        color: #fff;
    }

    .contact-card:focus {
        outline: 3px solid #fff;
        outline-offset: -3px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
