/* ============================================
   NOTE TYPE PICKER - V2 REDESIGN
   ============================================
   ARCHITECTURE: Clinical Command Center aesthetic
   WHY: Original was dated (white bg, emoji icons) - needs to match dark medical app
   DESIGN: Glass-morphism cards, Phosphor icons, 2-tier hierarchy, staggered reveals
   ============================================ */

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
    /* Picker Palette */
    --picker-backdrop: rgba(2, 6, 23, 0.92);
    --picker-backdrop-blur: 16px;

    /* Surface */
    --picker-surface: rgba(15, 23, 42, 0.95);
    --picker-surface-border: rgba(148, 163, 184, 0.15);

    /* Cards */
    --picker-card-bg: rgba(30, 41, 59, 0.6);
    --picker-card-border: rgba(148, 163, 184, 0.12);
    --picker-card-hover-bg: rgba(51, 65, 85, 0.7);
    --picker-card-hover-border: rgba(99, 102, 241, 0.5);

    /* Featured Card */
    --picker-featured-bg: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(59, 130, 246, 0.1));
    --picker-featured-border: rgba(99, 102, 241, 0.4);
    --picker-featured-glow: 0 0 40px -10px rgba(99, 102, 241, 0.5);

    /* Typography */
    --picker-text-primary: #f1f5f9;
    --picker-text-secondary: #94a3b8;
    --picker-text-muted: #64748b;

    /* Accents */
    --picker-accent-primary: #6366f1;
    --picker-accent-blue: #3b82f6;
    --picker-accent-emerald: #10b981;
    --picker-accent-amber: #f59e0b;

    /* Animation */
    --picker-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --picker-duration: 0.4s;
}

/* ============================================
   BACKDROP OVERLAY
   ============================================ */
.note-picker-overlay {
    position: fixed;
    inset: 0;
    background: var(--picker-backdrop);
    backdrop-filter: blur(var(--picker-backdrop-blur));
    -webkit-backdrop-filter: blur(var(--picker-backdrop-blur));
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;

    /* Entry animation */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.note-picker-overlay:not([hidden]) {
    opacity: 1;
    visibility: visible;
}

.note-picker-overlay[hidden] {
    display: none;
}

/* ============================================
   MODAL SURFACE
   ============================================ */
.note-picker-surface {
    background: var(--picker-surface);
    border: 1px solid var(--picker-surface-border);
    border-radius: 24px;
    padding: 0;
    max-width: 720px;
    width: 100%;
    position: relative;
    overflow: hidden;

    /* Premium shadow */
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 24px 80px -20px rgba(0, 0, 0, 0.6),
        0 0 60px -20px rgba(99, 102, 241, 0.2);

    /* Entry animation */
    transform: translateY(20px) scale(0.96);
    opacity: 0;
    animation: pickerSurfaceEnter var(--picker-duration) var(--picker-ease) forwards;
    animation-delay: 0.1s;
}

@keyframes pickerSurfaceEnter {
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Decorative top gradient bar */
.note-picker-surface::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--picker-accent-primary) 0%,
        var(--picker-accent-blue) 50%,
        var(--picker-accent-emerald) 100%
    );
    opacity: 0.8;
}

/* ============================================
   CLOSE BUTTON
   ============================================ */
.note-picker-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.15);
    color: var(--picker-text-secondary);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.note-picker-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    transform: scale(1.05);
}

/* ============================================
   HEADER
   ============================================ */
.note-picker-header {
    padding: 32px 32px 24px;
    text-align: center;
    position: relative;
}

.note-picker-header h3 {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--picker-text-primary);
    letter-spacing: -0.02em;
}

.note-picker-header p {
    margin: 0;
    color: var(--picker-text-secondary);
    font-size: 14px;
}

/* ============================================
   CARDS GRID - 2-TIER HIERARCHY
   ============================================ */
.note-picker-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 24px 28px;
}

/* Primary row - large cards */
.note-picker-primary-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

/* Secondary row - compact cards */
.note-picker-secondary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.08);
}

/* ============================================
   CARD BASE STYLES
   ============================================ */
.note-picker-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px 18px;
    border-radius: 16px;
    background: var(--picker-card-bg);
    border: 1px solid var(--picker-card-border);
    cursor: pointer;
    position: relative;
    overflow: hidden;

    /* Animation entry */
    opacity: 0;
    transform: translateY(12px);
    animation: pickerCardEnter 0.5s var(--picker-ease) forwards;

    /* Transition for hover */
    transition:
        transform 0.25s var(--picker-ease),
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

/* Staggered entrance delays */
.note-picker-card:nth-child(1) { animation-delay: 0.15s; }
.note-picker-card:nth-child(2) { animation-delay: 0.2s; }
.note-picker-card:nth-child(3) { animation-delay: 0.25s; }
.note-picker-card:nth-child(4) { animation-delay: 0.3s; }
.note-picker-card:nth-child(5) { animation-delay: 0.35s; }

.note-picker-secondary-row .note-picker-card:nth-child(1) { animation-delay: 0.4s; }
.note-picker-secondary-row .note-picker-card:nth-child(2) { animation-delay: 0.45s; }
.note-picker-secondary-row .note-picker-card:nth-child(3) { animation-delay: 0.5s; }
.note-picker-secondary-row .note-picker-card:nth-child(4) { animation-delay: 0.55s; }

@keyframes pickerCardEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover state */
.note-picker-card:hover {
    background: var(--picker-card-hover-bg);
    border-color: var(--picker-card-hover-border);
    transform: translateY(-4px);
    box-shadow:
        0 12px 32px -8px rgba(0, 0, 0, 0.4),
        0 0 24px -8px rgba(99, 102, 241, 0.3);
}

/* Active/pressed state */
.note-picker-card:active {
    transform: translateY(-2px) scale(0.98);
}

/* Focus visible for accessibility */
.note-picker-card:focus-visible {
    outline: 2px solid var(--picker-accent-primary);
    outline-offset: 2px;
}

/* ============================================
   CARD ICON
   ============================================ */
.note-picker-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--picker-accent-blue);
    margin-bottom: 10px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.1);
    transition: all 0.25s ease;
}

.note-picker-card:hover .note-picker-icon {
    background: rgba(99, 102, 241, 0.2);
    color: var(--picker-accent-primary);
    transform: scale(1.08);
}

/* ============================================
   CARD TYPOGRAPHY
   ============================================ */
.note-picker-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--picker-text-primary);
    margin-bottom: 3px;
    text-align: center;
    letter-spacing: -0.01em;
}

.note-picker-desc {
    font-size: 11px;
    color: var(--picker-text-muted);
    text-align: center;
    line-height: 1.3;
}

/* ============================================
   FEATURED CARD (Conversation Progress)
   ============================================ */
.note-picker-featured {
    background: var(--picker-featured-bg);
    border-color: var(--picker-featured-border);
    box-shadow: var(--picker-featured-glow);
    position: relative;
}

.note-picker-featured::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 16px;
    background: linear-gradient(135deg,
        rgba(99, 102, 241, 0.3) 0%,
        transparent 50%,
        rgba(59, 130, 246, 0.2) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.note-picker-featured:hover::after {
    opacity: 1;
}

.note-picker-featured .note-picker-icon {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.note-picker-featured:hover .note-picker-icon {
    background: rgba(99, 102, 241, 0.3);
    color: #c7d2fe;
}

/* ============================================
   BADGE (New, Beta, etc.)
   ============================================ */
.note-picker-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 7px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--picker-accent-emerald), #059669);
    color: white;
    box-shadow: 0 2px 8px -2px rgba(16, 185, 129, 0.5);
}

/* ============================================
   SECONDARY CARDS (Compact)
   ============================================ */
.note-picker-secondary {
    padding: 14px 10px 12px;
}

.note-picker-secondary .note-picker-icon {
    width: 32px;
    height: 32px;
    font-size: 18px;
    margin-bottom: 8px;
    background: rgba(100, 116, 139, 0.15);
    color: var(--picker-text-secondary);
}

.note-picker-secondary:hover .note-picker-icon {
    background: rgba(99, 102, 241, 0.15);
    color: var(--picker-accent-primary);
}

.note-picker-secondary .note-picker-label {
    font-size: 12px;
}

.note-picker-secondary .note-picker-desc {
    font-size: 10px;
}

/* ============================================
   CATEGORY LABELS (Optional)
   ============================================ */
.note-picker-category {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--picker-text-muted);
    padding: 0 8px;
    margin-bottom: 10px;
}

/* ============================================
   KEYBOARD HINTS
   ============================================ */
.note-picker-kbd {
    position: absolute;
    bottom: 6px;
    right: 6px;
    font-size: 9px;
    font-family: ui-monospace, 'SF Mono', 'Cascadia Code', monospace;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--picker-text-muted);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.note-picker-card:hover .note-picker-kbd {
    opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 700px) {
    .note-picker-surface {
        max-width: calc(100vw - 32px);
        border-radius: 20px;
    }

    .note-picker-primary-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .note-picker-secondary-row {
        grid-template-columns: repeat(4, 1fr);
    }

    .note-picker-header {
        padding: 24px 24px 20px;
    }

    .note-picker-header h3 {
        font-size: 18px;
    }
}

@media (max-width: 500px) {
    .note-picker-primary-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .note-picker-secondary-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .note-picker-card {
        padding: 16px 10px 14px;
    }

    .note-picker-grid {
        padding: 0 16px 20px;
    }
}

/* ============================================
   QUICK ACCESS FOOTER (Optional)
   ============================================ */
.note-picker-footer {
    padding: 16px 24px;
    background: rgba(15, 23, 42, 0.5);
    border-top: 1px solid rgba(148, 163, 184, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.note-picker-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--picker-text-muted);
}

.note-picker-hint kbd {
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.15);
    font-family: ui-monospace, 'SF Mono', monospace;
    font-size: 11px;
}
