/* =================================
   ORAL CANCER AI DETECTION SYSTEM
   Custom CSS - WARM ORANGE THEME
   Energetic, Optimistic, Professional
   ================================= */

/* =============================================================================
   CSS VARIABLES FOR WARM ORANGE THEME
   ============================================================================= */

:root {
    /* Primary Orange Colors */
    --color-primary: #f59e0b;
    --color-secondary: #fb923c;
    --color-accent: #fbbf24;

    /* RGB values for alpha transparency */
    --color-primary-rgb: 245, 158, 11;
    --color-secondary-rgb: 251, 146, 60;
    --color-accent-rgb: 251, 191, 36;

    /* Shade variations */
    --color-primary-light: #fcd34d;
    --color-primary-dark: #d97706;
    --color-primary-darker: #b45309;

    /* Background tints */
    --color-primary-bg: #fffbeb;
    --color-primary-bg-light: #fff7ed;
}

/* =============================================================================
   1. BASE STYLES & UTILITIES
   ============================================================================= */

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
    background: #fff7ed;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #f59e0b, #fb923c);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #d97706, #ea580c);
}

/* Navigation Styles - ORANGE THEME */
.nav-link {
    color: #6b7280;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
    color: #f59e0b;
    background-color: #fff7ed;
}

.mobile-nav-link {
    display: block;
    color: #6b7280;
    font-weight: 500;
    padding: 0.75rem 1rem;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: #f59e0b;
    background-color: #fff7ed;
}

/* =============================================================================
   2. SCROLL TO TOP BUTTON - WARM ORANGE THEME
   ============================================================================= */

#scrollToTop {
    /* Position and Layout */
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;

    /* Perfect Circle Dimensions */
    width: 3.5rem;
    height: 3.5rem;
    min-width: 3.5rem;
    min-height: 3.5rem;

    /* Perfect Circle Shape */
    border-radius: 50%;

    /* Flexbox for Perfect Centering */
    display: flex;
    align-items: center;
    justify-content: center;

    /* Visual Styling - ORANGE GRADIENT */
    background: linear-gradient(135deg, #f59e0b, #fb923c);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.3),
        0 4px 6px -2px rgba(245, 158, 11, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);

    /* Remove default button styling */
    outline: none;

    /* Animation and Interaction */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    z-index: 1000;

    /* Initial Hidden State */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);

    /* Prevent text selection */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Show State */
#scrollToTop.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Hover Effects - ORANGE THEME */
#scrollToTop:hover {
    background: linear-gradient(135deg, #fb923c, #fbbf24);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 20px 25px -5px rgba(245, 158, 11, 0.4),
        0 10px 10px -5px rgba(245, 158, 11, 0.3);
}

/* Active State */
#scrollToTop:active {
    transform: translateY(0) scale(1.05);
}

/* Icon Styling */
#scrollToTop i {
    font-size: 1.25rem;
    line-height: 1;
}

/* Responsive Design */
@media (max-width: 640px) {
    #scrollToTop {
        bottom: 1rem;
        right: 1rem;
        width: 3rem;
        height: 3rem;
        min-width: 3rem;
        min-height: 3rem;
    }

    #scrollToTop i {
        font-size: 1rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #scrollToTop {
        border-width: 1px;
    }
}

/* Focus Styles for Accessibility - ORANGE THEME */
#scrollToTop:focus {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

/* Ensure Perfect Circle on All Browsers */
#scrollToTop {
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;

    /* Prevent any padding or margin issues */
    padding: 0;
    margin: 0;

    /* Ensure proper box-sizing */
    box-sizing: border-box;

    /* Prevent any overflow issues */
    overflow: hidden;
}

/* =============================================================================
   3. HERO SECTION ANIMATIONS
   ============================================================================= */

/* Floating animations for background elements */
@keyframes float {
    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

@keyframes float-delayed {
    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(-3deg);
    }
}

@keyframes smooth-slide-up {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-delayed 8s ease-in-out infinite;
    animation-delay: 2s;
}

.animate-pulse-slow {
    animation: pulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-fade-in {
    animation: fadeIn 1s ease-out forwards;
    opacity: 0;
}

.animate-slide-up {
    animation: slideUp 1s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

.animate-smooth-slide-up {
    animation: smooth-slide-up 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94)
        forwards;
    opacity: 0;
    transform: translateY(40px) scale(0.95);
}

/* =============================================================================
   4. MAIN ANIMATION KEYFRAMES
   ============================================================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceGentle {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ORANGE THEME GLOW */
@keyframes glow {
    from {
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.5);
    }
    to {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.8);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes loadingDots {
    0%,
    20% {
        content: "";
    }
    40% {
        content: ".";
    }
    60% {
        content: "..";
    }
    80%,
    100% {
        content: "...";
    }
}

/* =============================================================================
   5. ANIMATION UTILITY CLASSES
   ============================================================================= */

/* Animation class variations */
.animate-fade-in {
    animation: fadeIn 0.8s ease-in-out forwards;
}
.animate-slide-down {
    animation: slideDown 0.6s ease-out forwards;
}
.animate-slide-left {
    animation: slideLeft 0.6s ease-out forwards;
}
.animate-slide-right {
    animation: slideRight 0.6s ease-out forwards;
}
.animate-scale-up {
    animation: scaleUp 0.6s ease-out forwards;
}
.animate-bounce-gentle {
    animation: bounceGentle 2s ease-in-out infinite;
}
.animate-float {
    animation: float 6s ease-in-out infinite;
}
.animate-glow {
    animation: glow 2s ease-in-out infinite alternate;
}

/* Animation delays */
.animate-delay-100 {
    animation-delay: 0.1s;
}
.animate-delay-200 {
    animation-delay: 0.2s;
}
.animate-delay-300 {
    animation-delay: 0.3s;
}
.animate-delay-500 {
    animation-delay: 0.5s;
}

/* Scroll-triggered animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* =============================================================================
   6. SPECIAL EFFECTS & TEXT ANIMATIONS - ORANGE THEME
   ============================================================================= */

/* Gradient text animation - ORANGE THEME */
.gradient-text {
    background: linear-gradient(45deg, #f59e0b, #fb923c, #fbbf24);
    background-size: 200% 200%;
    animation: gradientShift 3s ease-in-out infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced hover effects - ORANGE THEME */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(245, 158, 11, 0.2),
        0 10px 10px -5px rgba(245, 158, 11, 0.1);
}

/* Loading animation improvements */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: "";
    animation: loadingDots 1.5s infinite;
}

/* =============================================================================
   7. BUTTON ENHANCEMENTS - ORANGE THEME
   ============================================================================= */

/* Enhanced button hover effects with smoother transitions */
.group:hover .group-hover\:animate-bounce {
    animation: bounce 1s infinite;
}

/* Smooth button transformations */
button {
    transform-origin: center;
    will-change: transform;
}

/* =============================================================================
   8. RESPONSIVE DESIGN ADJUSTMENTS
   ============================================================================= */

/* Responsive adjustments for hero section */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2.5rem !important;
        line-height: 1.1;
        margin-bottom: 1.5rem !important;
    }

    .hero-description {
        font-size: 1.25rem !important;
        margin-bottom: 2rem !important;
    }

    .animate-smooth-slide-up {
        animation-duration: 0.8s;
    }
}

@media (max-height: 600px) {
    .hero-title {
        font-size: 2rem !important;
        margin-bottom: 1rem !important;
    }

    .hero-description {
        font-size: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .hero-buttons {
        margin-bottom: 2rem !important;
    }
}

/* =============================================================================
   9. SAMPLE IMAGES & CARDS
   ============================================================================= */

.sample-image-card {
    transform-origin: center;
    will-change: transform;
}

.sample-image-card:hover {
    transform: scale(1.05);
}

/* =============================================================================
   10. PERFORMANCE OPTIMIZATIONS
   ============================================================================= */

/* Optimize animations for better performance */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* GPU acceleration for animations */
.animate-fade-in,
.animate-slide-up,
.animate-slide-down,
.animate-slide-left,
.animate-slide-right,
.animate-scale-up,
.hover-lift {
    will-change: transform, opacity;
}

/* =============================================================================
   11. PRINT STYLES
   ============================================================================= */

@media print {
    .animate-fade-in,
    .animate-slide-up,
    .animate-bounce-gentle {
        animation: none !important;
    }

    #scrollToTop,
    .loading-overlay {
        display: none !important;
    }
}

/* =============================================================================
   ALGORITHM PAGE SPECIFIC STYLES - ORANGE THEME
   ============================================================================= */

/* Workflow placeholder styling - ORANGE THEME */
.workflow-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
    border: 2px dashed #fed7aa;
    border-radius: 1rem;
    color: #92400e;
    font-size: 1.1rem;
    padding: 2rem;
    transition: all 0.3s ease;
}

.workflow-placeholder:hover {
    border-color: #fdba74;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
}

.workflow-placeholder i {
    margin-bottom: 1rem;
    opacity: 0.7;
}

/* Algorithm section animations */
.algorithm-section {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.algorithm-section:nth-child(2) {
    animation-delay: 0.1s;
}
.algorithm-section:nth-child(3) {
    animation-delay: 0.2s;
}
.algorithm-section:nth-child(4) {
    animation-delay: 0.3s;
}

/* Stage cards hover effects - ORANGE THEME */
.stage-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stage-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(245, 158, 11, 0.25);
}

/* Innovation cards - ORANGE THEME */
.innovation-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.innovation-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(245, 158, 11, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.innovation-card:hover::before {
    left: 100%;
}

/* Performance metrics grid - ORANGE THEME */
.performance-metric {
    transition: all 0.3s ease;
}

.performance-metric:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.15);
}

/* Technical architecture cards */
.tech-card {
    transition: all 0.3s ease;
    position: relative;
}

.tech-card:hover {
    transform: translateY(-10px);
}

.tech-card .tech-icon {
    transition: all 0.3s ease;
}

.tech-card:hover .tech-icon {
    transform: scale(1.1);
}

/* Responsive adjustments for algorithm page */
@media (max-width: 768px) {
    .workflow-placeholder {
        min-height: 300px;
        font-size: 1rem;
        padding: 1.5rem;
    }

    .stage-card {
        margin-bottom: 1.5rem;
    }

    .performance-metric {
        margin-bottom: 1rem;
    }
}

/* Navigation spy active states - ORANGE THEME */
.nav-spy-active {
    background: white !important;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.2) !important;
    transform: scale(1.05);
    border-left: 3px solid #f59e0b;
}

/* Smooth scroll behavior for algorithm page */
html {
    scroll-behavior: smooth;
}

/* Loading states for workflow image - ORANGE THEME */
.workflow-image-loading {
    background: linear-gradient(90deg, #fff7ed 25%, #ffedd5 50%, #fff7ed 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

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

/* Enhanced focus states for accessibility - ORANGE THEME */
.algorithm-nav-link:focus {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

/* Print styles for algorithm page */
@media print {
    .workflow-placeholder {
        border: 1px solid #000;
        background: none;
    }

    .stage-card,
    .innovation-card,
    .tech-card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}
