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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --gold-color: #f39c12;
    --bg-light: #f8f9fa;
    --bg-dark: #1a1a1a;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --text-gray: #6c757d;
    --border-color: #e9ecef;
    --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 15px 35px rgba(0, 0, 0, 0.25);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-gold: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease-out;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-bar {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 20px auto;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: white;
    border-radius: 2px;
    animation: loadProgress 2s ease-out forwards;
}

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

@keyframes loadProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-light);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.nav-logo i {
    margin-right: 10px;
    color: var(--accent-color);
}

.student-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.9rem;
    color: var(--text-gray);
}

.student-id {
    font-size: 0.8rem;
    opacity: 0.8;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: var(--secondary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
}

.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
    animation: backgroundMove 20s linear infinite;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
}

@keyframes backgroundMove {
    0% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.05) translate(-5px, -5px); }
    100% { transform: scale(1) translate(-10px, -10px); }
}

.hero-content {
    position: relative;
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 0 20px;
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.title-line {
    display: block;
    animation: slideInLeft 1s ease-out;
}

.title-line.highlight {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: slideInRight 1s ease-out;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
    animation: fadeIn 1s ease-out 0.5s both;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
    animation: fadeIn 1s ease-out 1s both;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold-color);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    animation: fadeIn 1s ease-out 1.5s both;
}

.cta-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 2px;
    height: 30px;
    background: white;
    position: relative;
}

.scroll-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -4px;
    width: 10px;
    height: 10px;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(45deg);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* Section Styles */
.section {
    padding: 100px 0;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-header {
    text-align: center;
    margin-bottom: 80px;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--gradient-secondary);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-gray);
    font-weight: 300;
}

.hover-instruction {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 25px;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.hover-instruction i {
    font-size: 1rem;
}

/* Introduction Section */
.intro-section {
    background: var(--bg-light);
    padding: 60px 0; /* Reduced from 100px */
}

.intro-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px; /* Reduced from 60px */
    align-items: start; /* Changed from center to start */
}

.text-block {
    margin-bottom: 20px; /* Reduced from 30px */
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.text-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.text-block p {
    font-size: 0.95rem; /* Reduced from 1.1rem */
    line-height: 1.6; /* Reduced from 1.8 */
    color: var(--text-dark);
}

.methodology h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem; /* Reduced from 1.8rem */
    color: var(--primary-color);
    margin-bottom: 20px; /* Reduced from 30px */
}

.method-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px; /* Reduced from 20px */
}

.method-card {
    background: white;
    padding: 20px 15px; /* Reduced from 30px 20px */
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.method-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.method-icon {
    width: 50px; /* Reduced from 60px */
    height: 50px; /* Reduced from 60px */
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px; /* Reduced from 20px */
    color: white;
    font-size: 1.3rem; /* Reduced from 1.5rem */
}

.method-card h4 {
    font-size: 1rem; /* Reduced from 1.2rem */
    color: var(--primary-color);
    margin-bottom: 8px; /* Reduced from 10px */
}

.method-card p {
    font-size: 0.85rem; /* Added smaller font size */
    margin-bottom: 5px;
}

.method-detail {
    font-size: 0.8rem; /* Reduced from 0.9rem */
    color: var(--text-gray);
    font-style: italic;
}

.intro-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px; /* Reduced from 40px */
}

.algorithm-demo {
    background: white;
    padding: 25px; /* Reduced from 40px */
    border-radius: 15px; /* Reduced from 20px */
    box-shadow: var(--shadow-medium);
    text-align: center;
}

.demo-title {
    font-size: 1rem; /* Reduced from 1.2rem */
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px; /* Reduced from 30px */
}

.channels {
    display: flex;
    align-items: center;
    gap: 12px; /* Reduced from 15px */
    flex-wrap: wrap;
    justify-content: center;
}

.channel {
    text-align: center;
}

.channel-label {
    font-size: 0.8rem; /* Reduced from 0.9rem */
    font-weight: 600;
    margin-bottom: 8px; /* Reduced from 10px */
    color: var(--text-dark);
}

.channel-box {
    width: 40px; /* Reduced from 50px */
    height: 40px; /* Reduced from 50px */
    border-radius: 6px; /* Reduced from 8px */
    border: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.red-channel .channel-box {
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    animation: channelPulse 2s ease-in-out infinite;
}

.green-channel .channel-box {
    background: linear-gradient(45deg, #51cf66, #8ce99a);
    animation: channelPulse 2s ease-in-out infinite 0.5s;
}

.blue-channel .channel-box {
    background: linear-gradient(45deg, #339af0, #74c0fc);
    animation: channelPulse 2s ease-in-out infinite 1s;
}

.result-channel .channel-box.rainbow {
    background: var(--gradient-primary);
    animation: channelPulse 2s ease-in-out infinite 1.5s;
}

.alignment-arrow {
    font-size: 1.5rem;
    color: var(--secondary-color);
    animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes channelPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
}

@keyframes arrowPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Algorithm Info Cards */
.algorithm-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.info-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.info-card i {
    font-size: 2rem;
    color: var(--secondary-color);
    min-width: 40px;
}

.info-card h4 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.info-card p {
    color: var(--text-gray);
    font-size: 0.95rem;
}

.info-card small {
    display: block;
    color: var(--text-gray);
    font-size: 0.8rem;
    font-style: italic;
    margin-top: 5px;
    opacity: 0.8;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.large-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.result-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.result-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.result-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-heavy);
}

.image-container {
    position: relative;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.result-card:hover img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.8));
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 25px;
    pointer-events: none; /* Allow clicks to pass through */
}

.result-card:hover .image-overlay {
    opacity: 1;
}

.overlay-content {
    color: white;
    width: 100%;
}

.overlay-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.metric {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.metric.highlight .value {
    color: var(--gold-color);
    font-weight: 600;
}

.metric.special {
    grid-column: 1 / -1;
    justify-content: center;
    font-weight: 600;
    color: var(--gold-color);
    margin-top: 5px;
}

.metric .label {
    opacity: 0.8;
}

.metric .value {
    font-weight: 600;
}

/* Large Images Section */
.large-images-section {
    background: var(--bg-light);
}

/* Improvements Section */
.improvements-section {
    background: white;
}

.improvements-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.improvement-text h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.features-list {
    margin-top: 15px; /* Reduced from 20px */
}

.features-list h4 {
    font-size: 1rem; /* Reduced from 1.2rem */
    color: var(--primary-color);
    margin-bottom: 8px; /* Reduced from 12px */
}

.features-list ul {
    list-style: none;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced from 10px */
    margin-bottom: 6px; /* Reduced from 8px */
    padding: 8px; /* Reduced from 10px */
    background: white; /* Changed from var(--bg-light) */
    border-radius: 6px; /* Reduced from 8px */
    transition: all 0.3s ease;
    font-size: 0.8rem; /* Reduced from 0.85rem */
    box-shadow: var(--shadow-light);
}

.features-list li:hover {
    background: var(--bg-light); /* Swapped logic */
    box-shadow: var(--shadow-medium); /* Enhanced shadow on hover */
    transform: translateX(3px); /* Reduced movement */
}

.features-list i {
    color: var(--secondary-color);
    font-size: 1.1rem;
    min-width: 20px;
}

.comparison-container {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
}

.comparison-item {
    flex: 1;
    text-align: center;
}

.comparison-item h4 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.comparison-item .image-container {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.comparison-item .image-container:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-medium);
}

.comparison-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.comparison-arrow {
    font-size: 2rem;
    color: var(--secondary-color);
    animation: bounceHorizontal 2s ease-in-out infinite;
}

@keyframes bounceHorizontal {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

.result-info {
    margin-top: 10px;
}

.method-tag {
    display: inline-block;
    padding: 5px 15px;
    background: var(--secondary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.method-tag.enhanced {
    background: var(--accent-color);
}

.improvement-note {
    display: flex;
    align-items: start;
    gap: 15px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 10px;
    border-left: 4px solid var(--secondary-color);
}

.improvement-note i {
    color: var(--secondary-color);
    font-size: 1.2rem;
    margin-top: 2px;
}

.improvement-note p {
    font-style: italic;
    color: var(--text-gray);
    line-height: 1.6;
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.footer-info p {
    opacity: 0.8;
    line-height: 1.6;
}

.footer-stats {
    display: flex;
    gap: 40px;
}

.footer-stats .stat {
    text-align: center;
}

.footer-stats .stat-number {
    font-size: 1.8rem;
    color: var(--gold-color);
}

.footer-stats .stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    opacity: 0.8;
}

/* Scroll to Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-medium);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top-btn:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

/* Animation Classes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        justify-content: center;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-light);
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }

    .intro-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .method-cards {
        grid-template-columns: 1fr;
    }

    .channels {
        flex-direction: column;
        gap: 10px;
    }

    .algorithm-info {
        grid-template-columns: 1fr;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .improvements-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .comparison-container {
        flex-direction: column;
        gap: 20px;
    }

    .comparison-arrow {
        transform: rotate(90deg);
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-stats {
        justify-content: center;
    }

    .student-info {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero-content {
        padding: 0 15px;
    }

    .section {
        padding: 60px 0;
    }

    .section-header {
        margin-bottom: 40px;
    }

    .hero-stats {
        gap: 15px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .comparison-item img {
        height: 150px;
    }
}

/* Image Modal Styles */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.modal-content {
    position: relative;
    margin: auto;
    max-width: 90vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10001;
    padding: 20px;
    box-sizing: border-box;
}

.modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 10px;
    transition: all 0.3s ease;
    z-index: 10002;
}

.modal-close:hover {
    color: var(--secondary-color);
    transform: scale(1.1);
}

#modal-image {
    max-width: 85vw;
    max-height: 65vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.modal-info {
    text-align: center;
    color: white;
    margin-top: 20px;
    padding: 0 20px;
    max-width: 700px;
    flex-shrink: 0;
    width: 100%;
}

.modal-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.modal-info p {
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 15px;
}

.modal-details {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
    max-width: 100%;
}

.modal-detail-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 18px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-detail-label {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.modal-detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
}

/* Make images clickable cursor */
.result-card img,
.improvement-img {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.result-card img:hover,
.improvement-img:hover {
    transform: scale(1.02);
}

/* Modal responsive design */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
        padding: 15px;
    }
    
    .modal-close {
        top: -35px;
        font-size: 1.5rem;
    }
    
    #modal-image {
        max-width: 90vw;
        max-height: 50vh;
    }
    
    .modal-info {
        margin-top: 15px;
        padding: 0 10px;
    }
    
    .modal-info h3 {
        font-size: 1.4rem;
        margin-bottom: 10px;
    }
    
    .modal-info p {
        font-size: 0.8rem;
    }
    
    .modal-details {
        gap: 15px;
    }
    
    .modal-detail-item {
        padding: 10px 14px;
        min-width: 120px;
    }
    
    .modal-detail-label {
        font-size: 0.7rem;
    }
    
    .modal-detail-value {
        font-size: 0.9rem;
    }
}