/* Custom Animations */
@keyframes pulse-soft {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes scan-line {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

/* Scanning Animation Overlay */
.scanning-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.scanning-content {
    background: white;
    padding: 3rem;
    border-radius: 1.5rem;
    text-align: center;
    max-width: 400px;
    animation: pulse-soft 2s infinite;
}

.scanning-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.scanning-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2563eb;
    margin-bottom: 0.5rem;
}

.scanning-subtext {
    color: #6b7280;
}

/* Scan Line Effect */
.scan-line-container {
    position: relative;
    overflow: hidden;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-top: 1.5rem;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    animation: scan-line 1.5s infinite;
}

/* Upload Box Active State */
.upload-box.active > div {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Tab Navigation Styles */
.diagnostic-tab {
    color: #6b7280;
    background: transparent;
}

.diagnostic-tab.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.diagnostic-tab:not(.active):hover {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.tab-content {
    animation: fadeInTab 0.3s ease;
}

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

/* Paywall Modal Animation */
@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.animate-modal-in {
    animation: modal-in 0.3s ease-out;
}

/* Quick Action Buttons */
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 90px;
}

.quick-action-btn:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15), 0 0 40px rgba(34, 197, 94, 0.1);
    transform: translateY(-2px);
}

.quick-action-btn:active {
    transform: translateY(0);
}

.quick-action-btn .quick-action-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
    line-height: 1.3;
}

.quick-action-btn:hover .quick-action-text {
    color: #1d4ed8;
}

@media (max-width: 640px) {
    .quick-action-btn {
        padding: 0.75rem;
        min-height: 80px;
    }
    
    .quick-action-btn .quick-action-text {
        font-size: 0.75rem;
    }
}

/* Professional Medical Report Styles */
.medical-report {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Report Header Dynamic Colors */
.report-header.header-red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: pulse-header-red 2s infinite;
}

.report-header.header-yellow {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.report-header.header-green {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.report-header.header-default {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

@keyframes pulse-header-red {
    0%, 100% {
        box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.2);
    }
}

/* Risk Indicator Styles */
.risk-indicator.risk-red {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left: 6px solid #ef4444;
}

.risk-indicator.risk-yellow {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left: 6px solid #f59e0b;
}

.risk-indicator.risk-green {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 6px solid #22c55e;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 1.125rem;
}

.status-badge.badge-red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
    animation: pulse-red 2s infinite;
}

.status-badge.badge-yellow {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.status-badge.badge-green {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
}

@keyframes pulse-red {
    0%, 100% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
    }
}

/* Analysis Content */
#analysisContent {
    line-height: 1.8;
    color: #374151;
}

#analysisContent h3 {
    color: #1e40af;
    font-size: 1.125rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#analysisContent h3:first-child {
    margin-top: 0;
}

#analysisContent p {
    margin-bottom: 1rem;
}

#analysisContent ul {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0;
}

#analysisContent li {
    padding: 0.5rem 0 0.5rem 1.75rem;
    position: relative;
}

#analysisContent li::before {
    content: "•";
    color: #3b82f6;
    font-weight: bold;
    position: absolute;
    left: 0.5rem;
}

/* Identification Result */
#identificationResult h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.id-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.id-item:last-child {
    border-bottom: none;
}

.id-label {
    color: #6b7280;
    font-size: 0.875rem;
}

.id-value {
    color: #1f2937;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Actionable Tips */
#actionableTips h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tips-list {
    display: grid;
    gap: 0.75rem;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tip-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.tip-text {
    color: #374151;
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* Report Content Styling */
#reportContent {
    line-height: 1.8;
}

#reportContent h1,
#reportContent h2,
#reportContent h3 {
    color: #1e40af;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

#reportContent ul,
#reportContent ol {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

#reportContent li {
    margin-bottom: 0.25rem;
}

/* AI Insight Bubble */
.ai-insight-bubble {
    position: absolute;
    top: 50%;
    right: -12px;
    transform: translateY(-50%) translateX(100%);
    background: rgba(219, 234, 254, 0.92);
    border: 1px solid rgba(147, 197, 253, 0.6);
    border-radius: 0.75rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
    color: #1e40af;
    max-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.12);
    z-index: 10;
    line-height: 1.4;
}

.ai-insight-bubble::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -6px;
    transform: translateY(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: rgba(219, 234, 254, 0.92);
    border-left: 1px solid rgba(147, 197, 253, 0.6);
    border-bottom: 1px solid rgba(147, 197, 253, 0.6);
}

.ai-insight-bubble.visible {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .ai-insight-bubble {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        margin-top: 0.5rem;
        max-width: 100%;
    }

    .ai-insight-bubble::before {
        display: none;
    }
}

/* Longevity Blueprint Premium Section */
.longevity-blueprint-container {
    background: linear-gradient(135deg, #fffdf7 0%, #f0fdf4 50%, #fffdf7 100%);
    border: 2px solid #d4a853;
    border-left: 4px solid #10b981;
    position: relative;
    box-shadow: 0 2px 12px rgba(212, 168, 83, 0.15), 0 0 0 1px rgba(16, 185, 129, 0.1);
}

.longevity-blueprint-heading {
    color: #1a5632;
}

.longevity-pro-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #d4a853 0%, #f0c56d 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    border-radius: 9999px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(212, 168, 83, 0.4);
}

.longevity-category {
    background: white;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.longevity-category-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.longevity-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.longevity-check-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.5;
}

.longevity-check-item input[type="checkbox"] {
    margin-top: 0.25rem;
    accent-color: #10b981;
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
}

/* Longevity Paywall Blur */
.longevity-blurred {
    filter: blur(10px);
    pointer-events: none;
    user-select: none;
    transition: filter 0.4s ease;
}

/* Longevity Paywall Overlay */
.longevity-paywall-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 1rem;
}

.longevity-paywall-content {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
}

.longevity-paywall-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 4px 12px rgba(212, 168, 83, 0.5));
}

.longevity-paywall-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.longevity-paywall-subtitle {
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.longevity-unlock-btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #d4a853 0%, #e8c36a 50%, #d4a853 100%);
    background-size: 200% 200%;
    color: #1a1a1a;
    font-weight: 800;
    font-size: 0.95rem;
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(212, 168, 83, 0.45), 0 0 0 2px rgba(212, 168, 83, 0.2);
    transition: all 0.3s ease;
    animation: gold-shimmer 3s ease infinite;
}

.longevity-unlock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(212, 168, 83, 0.6), 0 0 0 2px rgba(212, 168, 83, 0.3);
}

@keyframes gold-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.longevity-limited-offer {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #b45309;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    animation: pulse-soft 2s infinite;
}

/* Breed Notification Toast */
.breed-notification-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, rgba(255, 253, 247, 0.97) 0%, rgba(240, 253, 244, 0.97) 100%);
    border: 1px solid #d4a853;
    border-left: 4px solid #d4a853;
    padding: 0.875rem 1.25rem;
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(212, 168, 83, 0.15);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    color: #374151;
    max-width: 380px;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}

.breed-notification-toast.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.breed-toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .breed-notification-toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .longevity-paywall-content {
        padding: 1.25rem;
    }

    .longevity-paywall-title {
        font-size: 1.1rem;
    }

    .longevity-unlock-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
}

/* Welcome Modal */
.welcome-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    animation: fadeIn 0.3s ease;
}

.welcome-modal-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2.5rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    animation: modal-in 0.4s ease-out;
}

.welcome-modal-card input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fafafa;
}

.welcome-modal-card input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: white;
}

/* Hero Button Animations */
@keyframes hero-pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(37, 99, 235, 0.15), 0 0 0 0 rgba(37, 99, 235, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(37, 99, 235, 0.25), 0 0 0 8px rgba(37, 99, 235, 0);
    }
}

.hero-learn-more-pulse {
    animation: hero-pulse-glow 2s ease-in-out infinite;
}

@keyframes hero-flash-shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.hero-diagnosis-flash {
    background-image: linear-gradient(
        110deg,
        #2563eb 0%, #2563eb 30%,
        #60a5fa 45%, #93c5fd 50%, #60a5fa 55%,
        #2563eb 70%, #2563eb 100%
    ) !important;
    background-size: 200% 100%;
    animation: hero-flash-shimmer 2s linear infinite;
}

/* Floating Arrow for Learn More */
@keyframes arrow-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

.guide-arrow-float {
    position: absolute;
    top: -52px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: arrow-bounce 1.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
}

.guide-arrow-label {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.guide-arrow-icon {
    font-size: 1.25rem;
    color: #2563eb;
    line-height: 1;
}

@media (max-width: 640px) {
    .guide-arrow-float {
        top: -46px;
    }
}

/* Form Focus States */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* Button Disabled State */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Card Hover Effect */
.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.feature-card:hover {
    transform: translateY(-4px);
}

/* Feature Card PRO Badge */
.feature-pro-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    background: linear-gradient(135deg, #d4a853 0%, #f0c56d 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    border-radius: 9999px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(212, 168, 83, 0.4);
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .scanning-content {
        margin: 1rem;
        padding: 2rem;
    }
    
    .scanning-icon {
        font-size: 3rem;
    }
    
    .scanning-text {
        font-size: 1.25rem;
    }
}

/* Language Toggle Button */
.lang-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.lang-toggle-btn:hover {
    color: #2563eb;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.lang-toggle-btn:active {
    transform: scale(0.95);
}

.lang-toggle-icon {
    font-size: 16px;
    line-height: 1;
}

@media (max-width: 640px) {
    .lang-toggle-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    .lang-toggle-icon {
        font-size: 14px;
    }
}

/* Result Area Animation */
#resultArea {
    animation: fadeIn 0.5s ease;
}

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

/* Error State */
.error-shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}
