/* custom.css — CourtLookup.com custom styles (supplements Tailwind) */

/* Smooth transitions for HTMX swaps */
.htmx-settling {
    opacity: 0;
}
.htmx-swapping {
    opacity: 0;
    transition: opacity 0.15s ease-out;
}
.htmx-added {
    opacity: 1;
    transition: opacity 0.15s ease-in;
}

/* Loading indicator */
.htmx-indicator {
    display: none;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: block;
}

/* ----------------------------------------------------------------
   Typeahead Suggestion Dropdown
   ---------------------------------------------------------------- */
.suggestion-dropdown {
    position: absolute;
    z-index: 50;
    width: 100%;
    background: white;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-height: 280px;
    overflow-y: auto;
    display: none;
}

.suggestion-dropdown.active {
    display: block;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    transition: background-color 0.1s;
}

.suggestion-item:hover {
    background-color: #f3f4f6;
}

.suggestion-item:first-child {
    border-radius: 0;
}

.suggestion-item:last-child {
    border-radius: 0 0 0.5rem 0.5rem;
}

/* ----------------------------------------------------------------
   Case Detail Tabs
   ---------------------------------------------------------------- */
.case-tab {
    padding: 0.75rem 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.case-tab:hover {
    color: #1e3a5f;
    border-bottom-color: #d1d5db;
}

.case-tab.active-tab {
    color: #1e3a5f;
    border-bottom-color: #1e3a5f;
}

/* Tab content panel */
.tab-content-panel {
    min-height: 200px;
}

/* ----------------------------------------------------------------
   Skeleton Loading Animation
   ---------------------------------------------------------------- */
@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.skeleton {
    background: #e5e7eb;
    border-radius: 0.25rem;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* ----------------------------------------------------------------
   Paywall Blur & Overlay
   ---------------------------------------------------------------- */
.paywall-container {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
}

.paywall-blur {
    filter: blur(4px);
    user-select: none;
    pointer-events: none;
}

.paywall-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
    z-index: 10;
}

.paywall-overlay-content {
    text-align: center;
    padding: 2rem;
    max-width: 24rem;
}

/* ----------------------------------------------------------------
   Dashboard Sidebar
   ---------------------------------------------------------------- */
.dashboard-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    transition: background-color 0.15s, color 0.15s;
}

.dashboard-nav-item:hover {
    background-color: #f3f4f6;
    color: #1e3a5f;
}

.dashboard-nav-item.active {
    background-color: #eff6ff;
    color: #1e3a5f;
}

/* ----------------------------------------------------------------
   FAQ Accordion
   ---------------------------------------------------------------- */
.faq-item button {
    outline: none;
}

.faq-icon {
    transition: transform 0.2s ease;
}

.faq-answer {
    line-height: 1.6;
}

/* ----------------------------------------------------------------
   AI Analysis Components (Phase 3)
   ---------------------------------------------------------------- */

/* Analysis loading state — extend HTMX timeout for long AI calls */
[hx-indicator="#analysis-loading"] {
    /* HTMX will handle show/hide via .htmx-indicator class */
}

/* Smooth transition for analysis content swap */
#tab-content {
    transition: opacity 0.2s ease;
}

/* Probability bar animation */
.probability-bar {
    transition: width 0.6s ease-out;
}

/* Confidence badges */
.confidence-high {
    background-color: #dcfce7;
    color: #166534;
}
.confidence-medium {
    background-color: #fef9c3;
    color: #854d0e;
}
.confidence-low {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Analysis card hover effect */
.analysis-card {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.analysis-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}
