/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    --white: hsl(0, 0%, 100%);
    --black: hsl(240, 15%, 9%);
    --paragraph: hsl(0, 0%, 83%);
    --line: hsl(240, 9%, 17%);
    --primary: hsl(266, 92%, 58%);

    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--black);
    background-image: radial-gradient(
        at 88% 40%,
        hsla(240, 15%, 9%, 1) 0px,
        transparent 85%
      ),
      radial-gradient(at 49% 30%, hsla(240, 15%, 9%, 1) 0px, transparent 85%),
      radial-gradient(at 14% 26%, hsla(240, 15%, 9%, 1) 0px, transparent 85%),
      radial-gradient(at 0% 64%, hsla(263, 93%, 56%, 1) 0px, transparent 85%),
      radial-gradient(at 41% 94%, hsla(284, 100%, 84%, 1) 0px, transparent 85%),
      radial-gradient(at 100% 99%, hsla(306, 100%, 57%, 1) 0px, transparent 85%);
    color: var(--white);
    height: 100vh;
    overflow-x: hidden;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 20%;
    right: -10%;
    width: 600px !important;
    height: 600px !important;
    opacity: 0.03;
    z-index: -1;
    pointer-events: none;
    filter: blur(1px);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
}

/* Header Styles */
.header {
    background: hsla(240, 15%, 9%, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid hsla(0, 0%, 100%, 0.1);
    border-radius: 16px;
    position: sticky;
    top: 1rem;
    z-index: 100;
    transition: all 0.3s ease;
    margin: 1rem 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.header:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    border-color: rgba(139, 92, 246, 0.3);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-text {
    font-family: 'Euclid Galactic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.025em;
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    font-family: 'Euclid Galactic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 0.75rem 1.5rem;
    background: rgb(20 20 28);
    border: 1px solid rgb(255 255 255 / 0%);
    border-radius: 9px;
    color: var(--paragraph);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.3);
}

.nav-btn.active {
    background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%);
    color: var(--white);
    border-color: #8B5CF6;
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.4);
}

.nav-btn.disabled {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(160, 160, 160, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    opacity: 0.5;
}

.nav-btn.disabled:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(160, 160, 160, 0.5);
    transform: none;
    box-shadow: none;
}

/* Main Content */
.main {
    padding: 2rem 0 1rem 0;
    height: calc(100vh - 120px);
    display: flex;
    align-items: center;
}

/* Upload Section */
.upload-section {
    display: none;
    animation: fadeIn 0.6s ease-in-out;
    height: 100%;
}

.upload-section.active {
    display: block;
}

.upload-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
}

.upload-info {
    padding: 2rem 0;
}

.upload-title {
    font-family: 'Euclid Galactic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.upload-subtitle {
    font-size: 1.125rem;
    color: #a0a0a0;
    margin-bottom: 3rem;
}

.description {
    margin-bottom: 3rem;
}

.description p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--paragraph);
    margin-bottom: 1.5rem;
}

.run-diagnosis-btn {
    --purple-700: hsla(262, 83%, 35%, 1);
    --purple-600: hsla(262, 83%, 58%, 1);
    --border_radius: 30px;
    --transition: 0.3s ease-in-out;
    --offset: 2px;

    cursor: pointer;
    position: relative;

    display: flex;
    align-items: center;
    gap: 0.5rem;

    transform-origin: center;

    padding: 1rem 2.5rem;
    background-color: transparent;

    border: none;
    border-radius: var(--border_radius);
    transform: scale(calc(1 + (var(--active, 0) * 0.1)));

    transition: transform var(--transition);
    font-size: 1.125rem;
    font-weight: 300;
}

.run-diagnosis-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%);

    border-radius: var(--border_radius);
    box-shadow: inset 0 0.5px hsl(0, 0%, 100%), inset 0 -1px 2px 0 hsl(0, 0%, 0%),
        0px 4px 10px -4px hsla(0 0% 0% / calc(1 - var(--active, 0))),
        0 0 0 calc(var(--active, 0) * 0.375rem) hsla(262, 83%, 58%, 0.75);

    transition: all var(--transition);
    z-index: 0;
}

.run-diagnosis-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #A855F7 0%, #8B5CF6 100%);
    background-image: radial-gradient(
            at 51% 89%,
            hsla(262, 45%, 74%, 1) 0px,
            transparent 50%
        ),
        radial-gradient(at 100% 100%, hsla(262, 36%, 60%, 1) 0px, transparent 50%),
        radial-gradient(at 22% 91%, hsla(262, 36%, 60%, 1) 0px, transparent 50%);
    background-position: top;

    opacity: var(--active, 0);
    border-radius: var(--border_radius);
    transition: opacity var(--transition);
    z-index: 2;
}

.run-diagnosis-btn:is(:hover, :focus-visible) {
    --active: 1;
}

.run-diagnosis-btn:active {
    transform: scale(1);
}

.run-diagnosis-btn .dots_border {
    --size_border: calc(100% + 2px);

    overflow: hidden;

    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: var(--size_border);
    height: var(--size_border);
    background-color: transparent;

    border-radius: var(--border_radius);
    z-index: -10;
}

.run-diagnosis-btn .dots_border::before {
    content: "";
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    transform-origin: left;
    transform: rotate(0deg);

    width: 100%;
    height: 2rem;
    background-color: white;

    mask: linear-gradient(transparent 0%, white 120%);
    animation: rotate 2s linear infinite;
}

.run-diagnosis-btn .lottie-animation {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.run-diagnosis-btn.processing .lottie-animation {
    opacity: 1;
}

.run-diagnosis-btn.processing .sparkle {
    opacity: 0;
}

.run-diagnosis-btn .sparkle {
    position: relative;
    z-index: 10;
    width: 1.75rem;
    transition: opacity 0.3s ease;
}

.run-diagnosis-btn .sparkle .path {
    fill: currentColor;
    stroke: currentColor;

    transform-origin: center;

    color: var(--white);
}

.run-diagnosis-btn:is(:hover, :focus) .sparkle .path {
    animation: path 1.5s linear 0.5s infinite;
}

.run-diagnosis-btn .sparkle .path:nth-child(1) {
    --scale_path_1: 1.2;
}

.run-diagnosis-btn .sparkle .path:nth-child(2) {
    --scale_path_2: 1.2;
}

.run-diagnosis-btn .sparkle .path:nth-child(3) {
    --scale_path_3: 1.2;
}

.run-diagnosis-btn .text_button {
    font-family: 'Euclid Galactic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    z-index: 10;

    background-image: linear-gradient(
        90deg,
        hsla(0 0% 100% / 1) 0%,
        hsla(0 0% 100% / var(--active, 0)) 120%
    );
    background-clip: text;
    -webkit-background-clip: text;

    font-size: 1.125rem;
    font-weight: 600;
    color: var(--white);
}

/* For browsers that support background-clip: text */
@supports (background-clip: text) or (-webkit-background-clip: text) {
    .run-diagnosis-btn .text_button {
        color: transparent;
    }
}

/* Development Skip Button */
.dev-skip-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(107, 114, 128, 0.1);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    color: #9CA3AF;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    opacity: 0.7;
}

.dev-skip-btn:hover {
    background: rgba(107, 114, 128, 0.2);
    border-color: rgba(107, 114, 128, 0.5);
    color: #D1D5DB;
    transform: translateY(-2px);
    opacity: 1;
}

.dev-skip-btn svg {
    transition: transform 0.3s ease;
}

.dev-skip-btn:hover svg {
    transform: scale(1.1);
}

.upload-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
    margin-top: 6rem;
}

.single-zone-upload {
    display: flex;
    justify-content: center;
    width: 100%;
}

.single-dropzone {
    max-width: 500px;
    width: 100%;
}

.upload-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Eye disease specific dropzone styling with high specificity */
.single-zone-upload .single-dropzone .upload-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.2) !important;
    border-radius: 16px !important;
    padding: 12rem 1.5rem !important;
    text-align: center !important;
    background: rgba(255, 255, 255, 0.02) !important;
    backdrop-filter: blur(10px) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
    min-height: 200px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

.upload-label {
    font-family: 'Euclid Galactic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #8B5CF6;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
}

.upload-dropzone:hover {
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(139, 92, 246, 0.05);
    transform: translateY(-4px);
    box-shadow: 0 16px 64px rgba(139, 92, 246, 0.2);
}

.upload-dropzone.dragover {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    color: #8B5CF6;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 2;
}

.upload-dropzone:hover .upload-icon {
    transform: scale(1.1) translateY(-4px);
}

.sample-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 3;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    border-radius: 16px;
    pointer-events: none;
}



.sample-image {
    max-width: 80%;
    max-height: 80%;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s ease;
}

.upload-preview {
    max-width: 80%;
    max-height: 80%;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s ease;
    object-fit: cover;
}

.upload-dropzone:hover .sample-image-container {
    opacity: 1;
}

.upload-dropzone:hover .sample-image {
    transform: scale(1.02);
}

.upload-text {
    font-family: 'Euclid Galactic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.upload-format {
    font-size: 0.875rem;
    color: #a0a0a0;
}

.upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.sample-data {
    text-align: center;
}

.sample-link {
    color: #8B5CF6;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.sample-link:hover {
    color: #A855F7;
}

.sample-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%);
    transition: width 0.3s ease;
}

.sample-link:hover::after {
    width: 100%;
}

/* Analysis Section */
.analysis-section {
    display: none;
    animation: fadeIn 0.6s ease-in-out;
    height: 100%;
}

.analysis-section.active {
    display: block;
}

.analysis-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
}

.analysis-info {
    padding: 2rem 0;
}

.analysis-title {
    font-family: 'Euclid Galactic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.analysis-subtitle {
    font-size: 1.125rem;
    color: #a0a0a0;
    margin-bottom: 3rem;
}



.score-title {
    font-family: 'Euclid Galactic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 1.5rem;
}

.score-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    justify-content: start;
    margin-bottom: 3rem;
    max-width: 46%;
}

.score-item {
    text-align: center;
}

.score-label {
    font-size: 0.875rem;
    color: #a0a0a0;
    margin-bottom: 0.5rem;
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    animation: countUp 1s ease-out;
}

.score-value.high {
    color: #EF4444;
}

.score-value.low {
    color: #10B981;
}

.score-percent {
    font-size: 1.5rem;
    font-weight: 400;
}

.score-status {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    display: inline-block;
}

.score-status.high {
    background: rgba(239, 68, 68, 0.2);
    color: #EF4444;
}

.score-status.low {
    background: rgba(16, 185, 129, 0.2);
    color: #10B981;
}

/* Eye Disease Analysis */
.eye-analysis {
    width: 100%;
}

.eye-conditions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.condition-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.condition-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
}

.condition-label {
    font-family: 'Euclid Galactic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--white);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.condition-value {
    font-family: 'Euclid Galactic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.condition-value.high {
    color: #EF4444;
}

.condition-value.medium {
    color: #F59E0B;
}

.condition-value.low {
    color: #10B981;
}

.condition-value.normal {
    color: #3B82F6;
}

.condition-percent {
    font-size: 1.25rem;
    font-weight: 400;
    opacity: 0.8;
}

.image-thumbnails {
    margin-bottom: 2rem;
    max-width: 60%;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.thumbnail-item {
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 1;
    height: 80px;
}

.thumbnail-item:hover {
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.2);
}

.thumbnail-item.active {
    border-color: #8B5CF6;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.thumbnail-item:hover .thumbnail-image {
    transform: scale(1.05);
}

.thumbnail-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 0.25rem;
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
}

/* Grad-CAM Styles */
.gradcam-title {
    font-family: 'Euclid Galactic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 1rem;
    margin-top: 1rem;
}

.gradcam-grid {
    margin-bottom: 1rem;
}

.gradcam-item {
    border-color: rgba(255, 255, 255, 0.3);
}

.gradcam-item:hover {
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.7);
}

.gradcam-item.active {
    border-color: #ffffff;
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.7);
}

.gradcam-overlay {
    position: relative;
}

.gradcam-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(255, 0, 0, 0.3) 0%, 
        rgba(255, 165, 0, 0.4) 30%, 
        rgba(255, 255, 0, 0.3) 60%, 
        rgba(0, 255, 0, 0.2) 100%);
    mix-blend-mode: overlay;
    opacity: 0.8;
    pointer-events: none;
}

.process-info {
    margin-top: 1rem;
}

.process-time, .process-date {
    font-size: 0.875rem;
    color: #a0a0a0;
    margin-bottom: 0.25rem;
}

.new-diagnosis-btn {
    --purple-700: hsla(262, 83%, 35%, 1);
    --purple-600: hsla(262, 83%, 58%, 1);
    --border_radius: 12px;
    --transition: 0.3s ease-in-out;
    --offset: 2px;

    cursor: pointer;
    position: relative;

    display: flex;
    align-items: center;
    gap: 0.5rem;

    transform-origin: center;

    padding: 1rem 2.5rem;
    background-color: transparent;

    border: none;
    border-radius: var(--border_radius);
    transform: scale(calc(1 + (var(--active, 0) * 0.1)));

    transition: transform var(--transition);
    font-size: 1.125rem;
    font-weight: 600;
}

.new-diagnosis-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%);

    border-radius: var(--border_radius);
    box-shadow: inset 0 0.5px hsl(0, 0%, 100%), inset 0 -1px 2px 0 hsl(0, 0%, 0%),
        0px 4px 10px -4px hsla(0 0% 0% / calc(1 - var(--active, 0))),
        0 0 0 calc(var(--active, 0) * 0.375rem) hsla(262, 83%, 58%, 0.75);

    transition: all var(--transition);
    z-index: 0;
}

.new-diagnosis-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #A855F7 0%, #8B5CF6 100%);
    background-image: radial-gradient(
            at 51% 89%,
            hsla(262, 45%, 74%, 1) 0px,
            transparent 50%
        ),
        radial-gradient(at 100% 100%, hsla(262, 36%, 60%, 1) 0px, transparent 50%),
        radial-gradient(at 22% 91%, hsla(262, 36%, 60%, 1) 0px, transparent 50%);
    background-position: top;

    opacity: var(--active, 0);
    border-radius: var(--border_radius);
    transition: opacity var(--transition);
    z-index: 2;
}

.new-diagnosis-btn:is(:hover, :focus-visible) {
    --active: 1;
}

.new-diagnosis-btn:active {
    transform: scale(1);
}

.new-diagnosis-btn .dots_border {
    --size_border: calc(100% + 2px);

    overflow: hidden;

    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: var(--size_border);
    height: var(--size_border);
    background-color: transparent;

    border-radius: var(--border_radius);
    z-index: -10;
}

.new-diagnosis-btn .dots_border::before {
    content: "";
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    transform-origin: left;
    transform: rotate(0deg);

    width: 100%;
    height: 2rem;
    background-color: white;

    mask: linear-gradient(transparent 0%, white 120%);
    animation: rotate 2s linear infinite;
}

.new-diagnosis-btn .lottie-animation {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.new-diagnosis-btn.processing .lottie-animation {
    opacity: 1;
}

.new-diagnosis-btn.processing .sparkle {
    opacity: 0;
}

.new-diagnosis-btn .sparkle {
    position: relative;
    z-index: 10;
    width: 1.75rem;
    transition: opacity 0.3s ease;
}

.new-diagnosis-btn .sparkle .path {
    fill: currentColor;
    stroke: currentColor;

    transform-origin: center;

    color: var(--white);
}

.new-diagnosis-btn:is(:hover, :focus) .sparkle .path {
    animation: path 1.5s linear 0.5s infinite;
}

.new-diagnosis-btn .sparkle .path:nth-child(1) {
    --scale_path_1: 1.2;
}

.new-diagnosis-btn .sparkle .path:nth-child(2) {
    --scale_path_2: 1.2;
}

.new-diagnosis-btn .sparkle .path:nth-child(3) {
    --scale_path_3: 1.2;
}

.new-diagnosis-btn .text_button {
    font-family: 'Euclid Galactic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    z-index: 10;

    background-image: linear-gradient(
        90deg,
        hsla(0 0% 100% / 1) 0%,
        hsla(0 0% 100% / var(--active, 0)) 120%
    );
    background-clip: text;
    -webkit-background-clip: text;

    font-size: 1.125rem;
    font-weight: 600;
    color: var(--white);
}

/* For browsers that support background-clip: text */
@supports (background-clip: text) or (-webkit-background-clip: text) {
    .new-diagnosis-btn .text_button {
        color: transparent;
    }
}

/* Medical Imagery */
.medical-imagery {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 15px;
}

.main-image-container {
    width: 100%;
    max-width: 500px;
}

.image-viewer {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.zoom-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.zoom-btn:hover {
    background: rgba(139, 92, 246, 0.8);
    transform: scale(1.1);
}

.image-wrapper {
    position: relative;
    overflow: hidden;
    cursor: grab;
    transition: transform 0.3s ease;
    transform-origin: center;
}

.image-wrapper:active {
    cursor: grabbing;
}

.main-image {
    width: 100%;
    height: 600px;
    object-fit: cover;
    display: block;
    filter: contrast(1.2) brightness(0.9);
}

.main-image.gradcam-main-overlay {
    position: relative;
}

.main-image.gradcam-main-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(255, 0, 0, 0.25) 0%, 
        rgba(255, 165, 0, 0.35) 30%, 
        rgba(255, 255, 0, 0.25) 60%, 
        rgba(0, 255, 0, 0.15) 100%);
    mix-blend-mode: screen;
    opacity: 0.7;
    pointer-events: none;
    z-index: 1;
}

.detection-box {
    position: absolute;
    border: 2px solid;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    pointer-events: none;
    transition: all 0.3s ease;
}

.detection-box.malignant {
    border-color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.detection-box.benign {
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.1);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.detection-box.gradcam-detection {
    z-index: 2;
}

.detection-box.attention {
    border-color: #FF6B6B;
    background: rgba(255, 107, 107, 0.15);
    box-shadow: 0 0 25px rgba(255, 107, 107, 0.6);
    border-style: dashed;
}

.detection-box.focus {
    border-color: #4ECDC4;
    background: rgba(78, 205, 196, 0.15);
    box-shadow: 0 0 25px rgba(78, 205, 196, 0.6);
    border-style: dotted;
}

.detection-label {
    position: absolute;
    top: -45px;
    left: 0;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.malignant .detection-label {
    background: rgba(239, 68, 68, 0.9);
}

.benign .detection-label {
    background: rgba(16, 185, 129, 0.9);
}

.attention .detection-label {
    background: rgba(255, 107, 107, 0.9);
}

.focus .detection-label {
    background: rgba(78, 205, 196, 0.9);
}

.confidence {
    display: block;
    font-size: 0.7rem;
    opacity: 0.9;
}

.image-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.image-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.fullscreen-btn:hover {
    background: rgba(139, 92, 246, 0.8);
}

.download-btn:hover {
    background: rgba(139, 92, 246, 0.8);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-container {
    width: 95vw;
    height: 95vh;
    background: rgba(20, 20, 28, 0.95);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.8);
    transform: scale(1.1);
}

.modal-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.modal-zoom-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.modal-image-wrapper {
    width: 95vw;
    height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
    transform-origin: center;
    transition: transform 0.3s ease;
}

.modal-image-wrapper:active {
    cursor: grabbing;
}

.modal-image {
    width: 95vw;
    height: 95vh;
    object-fit: contain;
}

.modal-image.gradcam-main-overlay {
    position: relative;
}

.modal-image.gradcam-main-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(255, 0, 0, 0.3) 0%, 
        rgba(255, 165, 0, 0.4) 30%, 
        rgba(255, 255, 0, 0.3) 60%, 
        rgba(0, 255, 0, 0.2) 100%);
    mix-blend-mode: overlay;
    opacity: 0.6;
    pointer-events: none;
}

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

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

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }
}

@keyframes shineRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes rotate {
    to {
        transform: rotate(360deg);
    }
}

@keyframes path {
    0%,
    34%,
    71%,
    100% {
        transform: scale(1);
    }
    17% {
        transform: scale(var(--scale_path_1, 1));
    }
    49% {
        transform: scale(var(--scale_path_2, 1));
    }
    83% {
        transform: scale(var(--scale_path_3, 1));
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .upload-content,
    .analysis-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        height: 100%;
    }
    
    .upload-title,
    .analysis-title {
        font-size: 2.5rem;
    }
    
    .nav {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .header {
        margin: 1rem;
        border-radius: 12px;
    }
    
    .header .container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .upload-title,
    .analysis-title {
        font-size: 2rem;
    }
    
    .upload-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .single-dropzone {
        max-width: 350px;
    }
    
    .upload-dropzone {
        padding: 2rem 1rem;
        min-height: 150px;
    }
    
    /* Keep eye disease dropzone large even on mobile */
    .single-zone-upload .single-dropzone .upload-dropzone {
        padding: 8rem 1rem !important;
        min-height: 300px !important;
    }
    
    .score-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .eye-conditions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .image-thumbnails {
        max-width: 100%;
    }
    
    .thumbnail-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .thumbnail-item {
        height: 60px;
    }
    
    .main-image-container {
        max-width: 100%;
    }
    
    .medical-imagery {
        padding-bottom: 15px;
    }
    
    .main-image {
        height: 400px;
    }
    
    .zoom-controls {
        top: 0.5rem;
        right: 0.5rem;
        gap: 0.25rem;
    }
    
    .zoom-btn {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
    
    .background-animation {
        width: 400px !important;
        height: 400px !important;
        top: 30%;
        right: -20%;
        opacity: 0.02;
    }
}

@media (max-width: 480px) {
    .header {
        margin: 0.5rem;
        border-radius: 10px;
    }
    
    .nav {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .nav-btn {
        padding: 0.75rem 0.5rem;
        font-size: 0.7rem;
        text-align: center;
    }
    
    .upload-title,
    .analysis-title {
        font-size: 1.75rem;
    }
    
    .run-diagnosis-btn,
    .new-diagnosis-btn {
        width: 100%;
        padding: 1rem;
    }
    
    .run-diagnosis-btn .sparkle,
    .new-diagnosis-btn .sparkle {
        width: 1.25rem;
    }
    
    .run-diagnosis-btn .text_button,
    .new-diagnosis-btn .text_button {
        font-size: 1rem;
    }
    
    .background-animation {
        width: 300px !important;
        height: 300px !important;
        top: 40%;
        right: -30%;
        opacity: 0.015;
    }
    
    .upload-content,
    .analysis-content {
        height: 100%;
    }
    
    /* Keep eye disease dropzone prominent on small mobile */
    .single-zone-upload .single-dropzone .upload-dropzone {
        padding: 6rem 1rem !important;
        min-height: 250px !important;
    }
    
    .medical-imagery {
        padding-bottom: 15px;
    }
    
    .main-image {
        height: 300px;
    }
    
    .zoom-controls {
        top: 0.25rem;
        right: 0.25rem;
        gap: 0.25rem;
    }
    
    .zoom-btn {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }
    
    .thumbnail-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.25rem;
    }
    
    .thumbnail-item {
        height: 50px;
    }
    
    .thumbnail-label {
        font-size: 0.6rem;
        padding: 0.2rem;
    }
    
    .gradcam-title {
        font-size: 1rem;
        margin: 0.75rem 0 0.5rem 0;
    }
} 

#breastModelName {
  cursor: pointer;
  transition: color 0.2s, text-shadow 0.2s;
}

#breastModelName:hover {
  color: #8B5CF6;
  text-shadow: 0 0 6px #8B5CF6aa;
} 