/* Custom styles for medical code extraction app */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* Original Flow Container Styles - Used in both hero and original sections */
.flow-container {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
    z-index: 999999;
    width: 100%;
    max-width: 100%;
}

.step {
    position: relative;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    min-width: 120px;
    flex: 1;
    max-width: 150px;
}

.step:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
    width: 320px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #fff;
    text-align: left;
    padding: 16px;
    border-radius: 12px;
    z-index: 999999;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.step:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: #1a1a1a transparent transparent transparent;
}

.benefit {
    display: block;
    margin-top: 10px;
    font-style: italic;
    color: #a3a3a3;
    font-size: 13px;
}

.arrow {
    margin: 0 4px;
    color: rgba(255, 255, 255, 0.7);
    display: none;
}

/* Mobile responsive design */
@media (max-width: 767px) {
    .tooltip {
        width: 280px;
        left: 50%;
        transform: translateX(-50%);
        margin-left: 0;
    }
    
    /* Prevent tooltip from going off-screen on mobile */
    .flow-container .step:first-child .tooltip {
        left: 0;
        transform: none;
    }
    
    .flow-container .step:last-child .tooltip {
        right: 0;
        left: auto;
        transform: none;
    }
}

@media (min-width: 768px) {
    .flow-container {
        flex-wrap: nowrap;
        gap: 0;
    }
    .arrow {
        display: inline;
    }
    .step {
        margin: 0 3px;
        flex: none;
        min-width: 130px;
        max-width: 150px;
    }
}

/* Hero Flow Container - Same styling as original flow section */
.hero-flow-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    position: relative;
    z-index: 999999;
}

.hero-step {
    position: relative;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    min-width: 140px;
    flex: 1;
    max-width: 180px;
}

.hero-step:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.hero-arrow {
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.7);
    display: none;
}

.hero-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
    width: 320px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #fff;
    text-align: left;
    padding: 16px;
    border-radius: 12px;
    z-index: 999999;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hero-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: #1a1a1a transparent transparent transparent;
}

.hero-step:hover .hero-tooltip {
    visibility: visible;
    opacity: 1;
}

.hero-tooltip .benefit {
    display: block;
    margin-top: 10px;
    font-style: italic;
    color: #a3a3a3;
    font-size: 13px;
}

/* Mobile responsive for hero flow */
@media (max-width: 767px) {
    .hero-tooltip {
        width: 280px;
        left: 50%;
        transform: translateX(-50%);
        margin-left: 0;
    }
    
    .hero-flow-container .hero-step:first-child .hero-tooltip {
        left: 0;
        transform: none;
    }
    
    .hero-flow-container .hero-step:last-child .hero-tooltip {
        right: 0;
        left: auto;
        transform: none;
    }
}

@media (min-width: 768px) {
    .hero-flow-container {
        flex-wrap: nowrap;
        gap: 0;
    }
    .hero-arrow {
        display: inline;
    }
    .hero-step {
        margin: 0 5px;
        flex: none;
        min-width: 160px;
    }
}

/* Medical theme enhancements */
.text-info {
    color: var(--bs-info) !important;
}

/* Form styling */
#medical-note {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 200px;
}

#medical-note:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 202, 240, 0.25);
    border-color: var(--bs-info);
}

/* Loading spinner customization */
.spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Table enhancements */
.table th {
    border-bottom: 2px solid var(--bs-border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
    padding: 1rem 0.75rem;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: var(--bs-dark-bg-subtle);
}

/* MSO/Provider CTA Button Hover Effects */
.cta-button:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.4) !important;
    background: rgba(255,255,255,0.1) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.cta-button:active {
    transform: translateY(0px);
}

/* Voice dictation animations */
.pulse-animation {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Voice dictation button states */
#voice-dictation-btn.recording {
    background-color: var(--bs-danger);
    border-color: var(--bs-danger);
    color: white;
}

#voice-dictation-btn.recording:hover {
    background-color: var(--bs-danger);
    border-color: var(--bs-danger);
}

/* Voice status alert styling */
#voice-status {
    border-left: 4px solid var(--bs-info);
}

/* Code styling */
.table td:nth-child(2),
.table td:nth-child(3) {
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

/* Empty state styling */
#no-results {
    opacity: 0.7;
}

#no-results .fa-search {
    opacity: 0.5;
}

/* Card shadows */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card.shadow-sm {
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.15);
}

/* Custom star rating colors */
.rating-star-discrete.text-warning,
.rating-star.text-warning {
    color: rgb(253, 204, 13) !important;
}

.rating-star-discrete.text-warning-emphasis {
    color: rgb(253, 204, 13) !important;
    filter: brightness(1.1);
}

/* Rating interface styling */
#discreteRatingInterface {
    transition: all 0.3s ease;
}

.rating-star-discrete,
.rating-star {
    transition: color 0.2s ease;
}

/* Button enhancements */
.btn-primary {
    background-color: var(--bs-info);
    border-color: var(--bs-info);
}

.btn-primary:hover {
    background-color: var(--bs-info-hover, #0dcaf0);
    border-color: var(--bs-info-hover, #0dcaf0);
}

/* Alert styling */
.alert-warning {
    border-left: 4px solid var(--bs-warning);
}

.alert-danger {
    border-left: 4px solid var(--bs-danger);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .display-5 {
        font-size: 2rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .btn-lg {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
}

/* Animation for results */
#results-section {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus improvements for accessibility */
.btn:focus,
.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 202, 240, 0.25);
}

/* Footer styling */
footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--bs-border-color-translucent);
}

/* Entities Overview Styling */
.entity-list {
    min-height: 2.5rem;
    line-height: 1.4;
}

.entity-list .badge {
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--bs-gray-700) !important;
    background-color: var(--bs-gray-100) !important;
    border: 1px solid var(--bs-gray-300) !important;
    padding: 0.35rem 0.5rem;
    transition: all 0.15s ease-in-out;
}

.entity-list .badge:hover {
    background-color: var(--bs-gray-200) !important;
    border-color: var(--bs-gray-400) !important;
    transform: translateY(-1px);
}

/* Code System Badge Consistency */
.table .badge {
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--bs-gray-700) !important;
    background-color: var(--bs-gray-100) !important;
    border: 1px solid var(--bs-gray-300) !important;
    padding: 0.35rem 0.5rem;
}

/* Entities Overview Header */
#entities-overview .card-header {
    background-color: var(--bs-gray-50) !important;
    border-bottom: 1px solid var(--bs-gray-200);
}

#entities-overview .card-body {
    background-color: var(--bs-white);
}

/* Animated Entity Relationship Mapping Styles */
@keyframes dashFlow {
    to {
        stroke-dashoffset: -20;
    }
}

@keyframes pulseGlow {
    0%, 100% {
        filter: drop-shadow(0 0 5px currentColor);
        opacity: 0.6;
    }
    50% {
        filter: drop-shadow(0 0 15px currentColor);
        opacity: 1;
    }
}

@keyframes relationshipPulse {
    0%, 100% {
        r: 6;
        opacity: 0.3;
    }
    50% {
        r: 10;
        opacity: 0.7;
    }
}

@keyframes minimal-float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-2px);
    }
}

.relationship-group {
    cursor: pointer;
    transition: all 0.3s ease;
}

.relationship-group:hover {
    filter: brightness(1.2);
}

.relationship-svg {
    overflow: visible;
    pointer-events: none;
}

.relationship-svg .relationship-group {
    pointer-events: all;
}

.relationship-controls {
    border: 1px solid #dee2e6;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.relationship-controls .btn {
    transition: all 0.2s ease;
    border-radius: 6px;
    font-weight: 500;
}

.relationship-controls .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.relationship-controls .btn-outline-primary:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.relationship-controls .btn-outline-success:hover {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.relationship-controls .btn-outline-info:hover {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.relationship-controls .btn-outline-warning:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.relationship-controls .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

/* Entity grouping animations */
.entity-group {
    transition: all 0.3s ease;
}

.entity-group:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

/* Relationship tooltip styling */
#relationship-tooltip {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

/* Enhanced entity highlighting for relationships */
.relationship-highlighted {
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.9) !important;
    transform: scale(1.05) !important;
    z-index: 10 !important;
    position: relative !important;
}
