/* ================================================================
   FLOATING SETTLEMENT BUTTON - Premium Professional Design
   "This person knows what they're doing" energy
   ================================================================ */

.floating-settlement-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9000;
    
    /* Pill shape - compact but readable */
    height: 48px;
    padding: 0 20px 0 16px;
    border-radius: 24px;
    border: none;
    
    /* Premium dark with subtle depth */
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #f8f8f8;
    
    /* Refined shadow */
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    
    /* Interaction - ONLY transition specific properties, not 'all' */
    cursor: pointer;
    transition: box-shadow 0.3s ease, background 0.3s ease;
    
    /* Layout */
    display: flex;
    align-items: center;
    gap: 10px;
    
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    
    /* Initial state for entrance - starts offscreen */
    opacity: 0;
    transform: translateX(100px);
}

.floating-settlement-btn:hover {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, #1f1f3a 0%, #1a2744 100%);
}

/* Active state handled by animation, no transform conflict */

/* Icon with gold accent */
.floating-settlement-btn .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #d4af37 0%, #f4e4a6 50%, #d4af37 100%);
    border-radius: 50%;
    font-size: 0.95em;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

/* Label - visible initially, fades out when collapsed */
.floating-settlement-btn .btn-label {
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.95);
    max-width: 200px;
    opacity: 1;
    transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease,
                margin 0.4s ease;
}

/* ================================================================
   COLLAPSED STATE - Sphere with tooltip on hover
   ================================================================ */

.floating-settlement-btn.collapsed {
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    gap: 0;
    opacity: 1;
    transform: translateX(0);
    /* Smooth collapse transition */
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.4s ease,
                border-radius 0.4s ease,
                box-shadow 0.3s ease,
                background 0.3s ease;
}

.floating-settlement-btn.collapsed .btn-icon {
    width: 32px;
    height: 32px;
    font-size: 1.1em;
}

.floating-settlement-btn.collapsed .btn-label {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
}

/* Tooltip appears on hover when collapsed */
.floating-settlement-btn.collapsed::after {
    content: 'Settlement Agreement';
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    
    background: #1a1a2e;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
    
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Tooltip arrow */
.floating-settlement-btn.collapsed::before {
    content: '';
    position: absolute;
    right: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
    
    border: 6px solid transparent;
    border-left-color: #1a1a2e;
    
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.floating-settlement-btn.collapsed:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.floating-settlement-btn.collapsed:hover::before {
    opacity: 1;
}

/* Attention-grabbing entrance animation */
@keyframes slideInBounce {
    0% {
        opacity: 0;
        transform: translateX(100px);
    }
    60% {
        opacity: 1;
        transform: translateX(-8px);
    }
    80% {
        opacity: 1;
        transform: translateX(4px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 
            0 4px 20px rgba(0, 0, 0, 0.25),
            0 0 0 1px rgba(255, 255, 255, 0.05),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 
            0 4px 20px rgba(0, 0, 0, 0.25),
            0 0 0 1px rgba(255, 255, 255, 0.05),
            0 0 0 6px rgba(212, 175, 55, 0.5),
            0 0 30px rgba(212, 175, 55, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
}

/* Entrance animation - slide in with bounce, then glow 3 times */
.floating-settlement-btn.entrance {
    opacity: 1;
    transform: translateX(0);
    animation: slideInBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
               glowPulse 1.2s ease-in-out 0.7s 3;
}

/* ================================================================
   FLYING ANIMATION - Ball flies to clicked citation
   ================================================================ */

.floating-settlement-btn.flying {
    z-index: 10001; /* Above everything during flight */
    pointer-events: none;
}

.floating-settlement-btn.flying .btn-icon {
    animation: iconPulse 0.4s ease-out;
}

@keyframes iconPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Mobile - slightly smaller but still readable */
@media (max-width: 768px) {
    .floating-settlement-btn {
        bottom: 20px;
        right: 16px;
        height: 44px;
        padding: 0 16px 0 12px;
        gap: 8px;
    }
    .floating-settlement-btn .btn-icon {
        width: 24px;
        height: 24px;
        font-size: 0.85em;
    }
    .floating-settlement-btn .btn-label {
        font-size: 0.75em;
    }
    /* Collapsed state on mobile */
    .floating-settlement-btn.collapsed {
        width: 48px;
        height: 48px;
    }
    .floating-settlement-btn.collapsed .btn-icon {
        width: 26px;
        height: 26px;
    }
}

/* Hide when printing */
@media print {
    .floating-settlement-btn {
        display: none !important;
    }
}

/* ================================================================
   SETTLEMENT MODAL - Premium Document Viewer
   Looks like serious legal software
   ================================================================ */

.settlement-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.settlement-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.settlement-modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 1100px;
    max-height: 92vh;
    
    display: flex;
    flex-direction: column;
    overflow: hidden;
    
    box-shadow: 
        0 32px 64px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.settlement-modal-overlay.active .settlement-modal-content {
    transform: scale(1) translateY(0);
}

/* Header - Premium dark with gold accent bar */
.settlement-modal-header {
    display: flex;
    align-items: center;
    padding: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    position: relative;
}

/* Gold accent bar at top */
.settlement-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #d4af37 0%, #f4e4a6 50%, #d4af37 100%);
}

.settlement-modal-header-content {
    flex: 1;
    padding: 1.25rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 14px;
}

.settlement-modal-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #d4af37 0%, #f4e4a6 50%, #d4af37 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.settlement-modal-title {
    flex: 1;
}

.settlement-modal-title h2 {
    margin: 0;
    font-size: 1.15em;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.settlement-modal-title span {
    display: block;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    margin-top: 3px;
    letter-spacing: 0.02em;
}

.settlement-modal-close {
    width: 60px;
    height: 100%;
    min-height: 72px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settlement-modal-close:hover {
    background: rgba(220, 53, 69, 0.9);
    color: white;
}

/* Document info bar */
.settlement-modal-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 12px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.8em;
    color: #6c757d;
}

.settlement-modal-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.settlement-modal-info-item strong {
    color: #495057;
}

/* PDF viewer area */
.settlement-modal-body {
    flex: 1;
    min-height: 0;
    background: #525659;
    position: relative;
}

.settlement-modal-body iframe {
    width: 100%;
    height: 100%;
    min-height: 60vh;
    border: none;
    display: block;
}

/* ================================================================
   FLOATING DOWNLOAD SPHERE - Top right of modal body
   ================================================================ */

.settlement-download-sphere {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    
    /* Pure sphere */
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    
    /* Premium dark style */
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    text-decoration: none;
    
    /* Center the icon */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Subtle glow */
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 0 12px rgba(212, 175, 55, 0.3);
    
    transition: all 0.3s ease;
    cursor: pointer;
}

.settlement-download-sphere:hover {
    background: linear-gradient(135deg, #252542 0%, #1e2d4a 100%);
    color: white;
    transform: scale(1.1);
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.15),
        0 0 24px rgba(212, 175, 55, 0.5);
}

/* Tooltip on hover */
.settlement-download-sphere::after {
    content: 'Download PDF';
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    
    background: #1a1a2e;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    white-space: nowrap;
    
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.settlement-download-sphere:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.settlement-download-sphere .dl-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #d4af37 0%, #f4e4a6 50%, #d4af37 100%);
    border-radius: 50%;
}

.settlement-download-sphere .dl-icon svg {
    width: 14px;
    height: 14px;
    stroke: #1a1a2e;
}

/* Hide text label - tooltip shows instead */
.settlement-download-sphere .dl-text {
    display: none;
}

/* PC Retainer variant - green accent */
.settlement-download-sphere.pc-retainer .dl-icon {
    background: linear-gradient(135deg, #4caf50 0%, #81c784 50%, #4caf50 100%);
}

.settlement-download-sphere.pc-retainer {
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 0 12px rgba(76, 175, 80, 0.3);
}

.settlement-download-sphere.pc-retainer:hover {
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.15),
        0 0 24px rgba(76, 175, 80, 0.5);
}

/* ================================================================
   EXCERPT MODAL - Clean text display instead of PDF
   ================================================================ */

.settlement-excerpt-modal {
    max-width: 700px;
}

.settlement-excerpt-body {
    padding: 0;
}

.settlement-excerpt-text {
    padding: 2rem 2.5rem;
    background: #ffffff;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.1em;
    line-height: 1.8;
    color: #2c3e50;
}

.settlement-excerpt-text p {
    margin: 0;
}

.settlement-excerpt-text strong {
    background: linear-gradient(to bottom, transparent 60%, rgba(212, 175, 55, 0.3) 60%);
    font-weight: 600;
}

.settlement-excerpt-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    gap: 1rem;
}

.settlement-excerpt-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8em;
    color: #6c757d;
}

.settlement-excerpt-meta .meta-item {
    white-space: nowrap;
}

.view-full-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85em;
    transition: all 0.2s;
    white-space: nowrap;
}

.view-full-pdf-btn:hover {
    background: linear-gradient(135deg, #252542 0%, #1e2d4a 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .settlement-modal-overlay {
        padding: 12px;
    }
    .settlement-modal-content {
        max-height: 95vh;
        border-radius: 12px;
    }
    .settlement-modal-header-content {
        padding: 1rem 1.25rem;
        gap: 12px;
    }
    .settlement-modal-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1em;
    }
    .settlement-modal-title h2 {
        font-size: 1em;
    }
    .settlement-modal-close {
        width: 50px;
        min-height: 60px;
    }
    .settlement-modal-info {
        flex-wrap: wrap;
        gap: 12px;
        padding: 10px 16px;
    }
    .settlement-modal-body iframe {
        min-height: 50vh;
    }
    /* Download sphere on mobile */
    .settlement-download-sphere {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
    }
    .settlement-download-sphere .dl-icon {
        width: 24px;
        height: 24px;
    }
    .settlement-download-sphere .dl-icon svg {
        width: 12px;
        height: 12px;
    }
    /* Excerpt modal mobile */
    .settlement-excerpt-text {
        padding: 1.5rem;
        font-size: 1em;
    }
    .settlement-excerpt-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .settlement-excerpt-meta {
        justify-content: center;
    }
    .view-full-pdf-btn {
        justify-content: center;
    }
}
