* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #6366F1;
    --secondary-color: #10B981;
    --accent-color: #F59E0B;
    --background: #0F172A;
    --surface: #1E293B;
    --surface-light: #334155;
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --border-color: #475569;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
    --gradient-1: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    --gradient-2: linear-gradient(135deg, #F093FB 0%, #F5576C 100%);
    --gradient-3: linear-gradient(135deg, #4FACFE 0%, #00F2FE 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(79, 70, 229, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 1rem;
    animation: fadeInDown 0.8s ease-out;
}

.header-content {
    background: var(--surface);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 40px var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.title {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.title .icon {
    font-size: 2rem;
    -webkit-text-fill-color: initial;
    animation: pulse 2s ease-in-out infinite;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Section Styles */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-primary);
}

.section-icon {
    font-size: 1.25rem;
}

.control-section,
.comparison-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 10px 40px var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.6s ease-out;
}

/* Controls Section */
.controls {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
}

.dropdown-wrapper {
    position: relative;
    width: 100%;
}

.image-dropdown {
    width: 100%;
    padding: 0.625rem 2rem 0.625rem 0.875rem;
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--surface-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.image-dropdown:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.2);
}

.image-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2), 0 4px 15px rgba(79, 70, 229, 0.2);
}

.image-dropdown option {
    background: var(--surface);
    color: var(--text-primary);
    padding: 0.5rem;
}

.dropdown-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.image-dropdown:focus+.dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    justify-content: center;
}

.image-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 0.5rem;
    text-align: center;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.75rem;
}

/* Predict Button */
.predict-button {
    background: var(--gradient-1);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    min-width: 120px;
    justify-content: center;
}

/* Reset Button */
.reset-button {
    background: var(--surface-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    min-width: 120px;
    justify-content: center;
}

.reset-button:hover {
    border-color: var(--accent-color);
    background: var(--surface);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
    transform: translateY(-3px);
}

.reset-button:active {
    transform: translateY(-1px);
}

.reset-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.reset-button:disabled:hover {
    transform: none;
    border-color: var(--border-color);
    box-shadow: none;
}

.predict-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.predict-button:hover::before {
    width: 300px;
    height: 300px;
}

.predict-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.6);
}

.predict-button:active {
    transform: translateY(-1px);
}

.predict-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.predict-button:disabled:hover {
    transform: none;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.button-icon {
    font-size: 1.5rem;
    z-index: 1;
    position: relative;
}

.button-text {
    z-index: 1;
    position: relative;
}

.button-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 1;
    position: relative;
}

.predict-button.loading .button-text {
    display: none;
}

.predict-button.loading .button-loader {
    display: block;
}

/* Comparison Section */
.comparison-section {
    animation: fadeInUp 0.6s ease-out;
}

.comparison-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.comparison-item {
    flex: 1;
    min-width: 250px;
    animation: fadeInScale 0.6s ease-out;
}

.image-wrapper {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 30px var(--shadow-lg);
    border: 2px solid var(--border-color);
    background: var(--surface-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.comparison-item:first-child .image-wrapper {
    border-color: var(--primary-color);
}

.comparison-item:last-child .image-wrapper {
    border-color: var(--secondary-color);
}

.image-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px var(--shadow-lg);
}

.comparison-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.image-wrapper:hover .comparison-image {
    transform: scale(1.02);
}

.comparison-divider {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
    padding: 0 0.5rem;
}

.divider-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

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

/* Footer */
.footer {
    text-align: center;
    margin-top: 1rem;
    padding: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    animation: fadeIn 1s ease-out;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0.75rem;
    }

    .title {
        font-size: 1.5rem;
    }

    .title .icon {
        font-size: 1.75rem;
    }

    .header-content {
        padding: 0.75rem 1rem;
    }

    .control-section,
    .comparison-section {
        padding: 0.875rem;
    }

    .predict-button,
    .reset-button {
        padding: 0.625rem 1.25rem;
        font-size: 0.85rem;
    }

    .comparison-container {
        flex-direction: column;
        gap: 1rem;
    }

    .comparison-item {
        min-width: 100%;
    }

    .comparison-divider {
        transform: rotate(90deg);
        padding: 0.5rem 0;
    }

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

@media (max-width: 480px) {
    .title {
        font-size: 1.25rem;
    }

    .section-title {
        font-size: 1rem;
    }

    .button-group {
        flex-direction: column;
    }

    .predict-button,
    .reset-button {
        width: 100%;
    }
}