/* IMAGPlat Healthcare Demo Styles */
.card-gradient {
    background: linear-gradient(180deg, rgba(3, 12, 34, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.gradient-button {
    background-image: linear-gradient(to right, var(--tw-gradient-from), var(--tw-gradient-to));
}

.gradient-button:hover span {
    background-color: transparent;
}

.gradient-button:active {
    transform: scale(0.98);
}

.upload-area-dragover {
    border-color: rgb(34, 197, 94) !important;
    background-color: rgba(34, 197, 94, 0.1) !important;
    transform: scale(1.05) !important;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.5) !important;
}

/* Enhanced upload area */
#upload-area:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Enhanced result cards styling */
#diagnostic-cards > div,
#risk-cards > div {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
    backdrop-filter: blur(15px);
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

#diagnostic-cards > div:hover,
#risk-cards > div:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
    border-color: rgba(148, 163, 184, 0.25);
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.98), rgba(51, 65, 85, 0.95));
}

/* Enhanced typography */
#risk-cards h3,
#diagnostic-cards h3 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Arial', sans-serif;
    font-weight: 600;
    color: rgba(248, 250, 252, 0.92);
    font-size: 16px;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

#risk-cards p:not(.result-text),
#diagnostic-cards p:not(.result-text) {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Arial', sans-serif;
    font-weight: 500;
    color: rgba(203, 213, 225, 0.75);
    font-size: 14px;
    line-height: 1.4;
}

/* Diagnostic result text colors */
#diagnostic-cards .result-text.text-green-500 {
    color: #22c55e !important;
}

#diagnostic-cards .result-text.text-red-500 {
    color: #ef4444 !important;
}

#diagnostic-cards .result-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Arial', sans-serif;
    font-weight: 600;
    font-size: 24px;
    line-height: 1.4;
}

#risk-cards > div,
#diagnostic-cards > div {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

/* Enhanced section headers */
.card-gradient button {
    border-radius: 8px 8px 0 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-gradient button:hover {
    background: linear-gradient(90deg, rgba(8, 14, 28, 0.9), rgba(15, 23, 42, 0.9));
}

/* Redesigned map buttons */
.map-btn {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.7));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    letter-spacing: -0.01em;
    color: rgba(248, 250, 252, 0.85);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    min-height: 70px;
    position: relative;
    overflow: hidden;
}

.map-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.08), transparent);
    transition: left 0.5s;
}

.map-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(51, 65, 85, 0.9));
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.12);
    color: rgba(239, 68, 68, 0.9);
}

.map-btn:hover::before {
    left: 100%;
}

.map-btn:active {
    transform: translateY(-1px);
}

/* Smooth animations */
.transform.transition-transform {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mobile text wrapping and line height */
@media (max-width: 640px) {
    .risk-card h3 {
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        max-height: 2.4em;
        overflow: hidden;
    }
    
    .risk-percentage {
        white-space: nowrap;
    }
}

/* Realistic loading animations */
.loading-step {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.loading-step.active {
    opacity: 1;
}

.progress-bar {
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #ef4444, #f97316, #eab308);
    transition: width 0.5s ease-out;
    border-radius: 2px;
}

.model-loading-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    margin: 0 2px;
    animation: pulse 1.5s ease-in-out infinite;
}

.model-loading-indicator:nth-child(1) { animation-delay: 0s; }
.model-loading-indicator:nth-child(2) { animation-delay: 0.2s; }
.model-loading-indicator:nth-child(3) { animation-delay: 0.4s; }
.model-loading-indicator:nth-child(4) { animation-delay: 0.6s; }
.model-loading-indicator:nth-child(5) { animation-delay: 0.8s; }

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

/* Typewriter effect for loading messages */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #ef4444;
    white-space: nowrap;
    animation: typing 2s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #ef4444; }
}