/* 
   Modern Design System
   Unique warm terracotta and sage color palette for a sophisticated, earthy aesthetic
*/

/* Import premium Google Font */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* Root Variables - Custom Color Palette */
:root {
    /* Unique warm terracotta and sage palette - avoiding generic blues/purples */
    --primary-terracotta: #d4744a;
    --secondary-sage: #8a9a7b;
    --accent-coral: #e8927c;
    --neutral-cream: #f5f1e8;
    --dark-charcoal: #3a3635;
    --warm-sand: #e3d5c1;
    --soft-olive: #a3b18a;
    --deep-rust: #b55945;
    
    /* Gradients */
    --gradient-warm: linear-gradient(135deg, var(--primary-terracotta) 0%, var(--deep-rust) 100%);
    --gradient-earth: linear-gradient(135deg, var(--soft-olive) 0%, var(--secondary-sage) 100%);
    
    /* Shadows and Effects */
    --shadow-soft: 0 8px 32px rgba(180, 89, 69, 0.15);
    --shadow-medium: 0 12px 48px rgba(180, 89, 69, 0.2);
    --glow-terracotta: 0 0 20px rgba(212, 116, 74, 0.3);
    --glow-sage: 0 0 20px rgba(138, 154, 123, 0.3);
}

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

body {
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--neutral-cream) 0%, var(--warm-sand) 50%, var(--soft-olive) 100%);
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Animated background elements for visual interest */
body::before,
body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

body::before {
    width: 400px;
    height: 400px;
    background: var(--gradient-warm);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

body::after {
    width: 350px;
    height: 350px;
    background: var(--gradient-earth);
    bottom: -100px;
    right: -100px;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* Main Container with Glassmorphism Effect */
.container {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-medium);
    padding: 60px 50px;
    max-width: 500px;
    width: 100%;
    position: relative;
    z-index: 1;
    animation: slideIn 0.6s ease-out;
}

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

/* Header Styling */
h1 {
    color: var(--dark-charcoal);
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--deep-rust);
    font-size: 0.95rem;
    text-align: center;
    margin-top: 8px;
    font-weight: 400;
}

/* Input Section */
.input-section {
    margin-bottom: 30px;
}

label {
    display: block;
    color: var(--dark-charcoal);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.input-wrapper {
    position: relative;
}

input[type="number"] {
    width: 100%;
    padding: 16px 20px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    color: var(--dark-charcoal);
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid transparent;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
}

input[type="number"]:focus {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--primary-terracotta);
    box-shadow: var(--glow-terracotta);
    transform: translateY(-2px);
}

input[type="number"].error {
    border-color: var(--deep-rust);
    animation: shake 0.4s ease;
}

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

/* Button Styling */
button {
    width: 100%;
    padding: 16px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: white;
    background: var(--gradient-warm);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
    margin-top: 20px;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

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

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Result Display */
.result-container {
    margin-top: 30px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result {
    width: 100%;
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.result.show {
    opacity: 1;
    transform: scale(1);
}

.result.even {
    background: linear-gradient(135deg, rgba(163, 177, 138, 0.3) 0%, rgba(138, 154, 123, 0.3) 100%);
    border: 2px solid var(--secondary-sage);
    color: var(--dark-charcoal);
    animation: pulseGreen 0.6s ease;
}

.result.odd {
    background: linear-gradient(135deg, rgba(232, 146, 124, 0.3) 0%, rgba(212, 116, 74, 0.3) 100%);
    border: 2px solid var(--primary-terracotta);
    color: var(--dark-charcoal);
    animation: pulseOrange 0.6s ease;
}

@keyframes pulseGreen {
    0%, 100% { box-shadow: 0 0 0 0 rgba(138, 154, 123, 0.7); }
    50% { box-shadow: var(--glow-sage); }
}

@keyframes pulseOrange {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 116, 74, 0.7); }
    50% { box-shadow: var(--glow-terracotta); }
}

.result-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
}

.result-text {
    font-size: 1rem;
    opacity: 0.9;
}

/* Error Message */
.error-message {
    color: var(--deep-rust);
    font-size: 0.85rem;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-message.show {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 40px 30px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    input[type="number"] {
        font-size: 1rem;
        padding: 14px 18px;
    }
    
    button {
        font-size: 1rem;
        padding: 14px;
    }
    
    .result-number {
        font-size: 2rem;
    }
}

@media (max-width: 400px) {
    .container {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 1.4rem;
    }
}

/* Accessibility enhancements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
