@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700;800&display=swap');

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

body {
    font-family: 'Nunito', sans-serif;
    min-height: 100vh;
    background: linear-gradient(170deg, #e8f5e9 0%, #fff9c4 40%, #fce4ec 75%, #e1f5fe 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    font-size: 2.5rem;
    word-spacing: 3rem;
    line-height: 5rem;
    letter-spacing: 2rem;
    opacity: 0.10;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

h1 {
    font-size: 2.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #e91e63, #ff9800, #8bc34a, #03a9f4, #9c27b0);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 5s ease infinite;
    margin-bottom: 0.3rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    color: #7b8794;
    font-size: 1rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 1.5rem;
    padding: 2.5rem;
    max-width: 520px;
    width: 100%;
    box-shadow:
        0 4px 24px rgba(233, 30, 99, 0.08),
        0 1px 4px rgba(0,0,0,0.04);
    border: 2px solid rgba(255, 183, 77, 0.25);
    position: relative;
    z-index: 1;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 32px rgba(233, 30, 99, 0.12),
        0 2px 8px rgba(0,0,0,0.06);
}

.upload-form p {
    color: #546e7a;
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
    text-align: center;
}

.file-input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

input[type="file"] {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px dashed #ce93d8;
    border-radius: 1rem;
    background: #fce4ec33;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    color: #6a1b9a;
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
}

input[type="file"]:hover {
    border-color: #ab47bc;
    background: #f3e5f533;
}

button[type="submit"] {
    background: linear-gradient(135deg, #ff9800, #e91e63, #9c27b0);
    background-size: 200% 200%;
    color: white;
    border: none;
    padding: 0.85rem 2.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    border-radius: 3rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-position 0.4s ease;
    box-shadow: 0 4px 16px rgba(233, 30, 99, 0.3);
    letter-spacing: 0.03em;
}

button[type="submit"]:hover {
    transform: scale(1.05);
    background-position: 100% 50%;
    box-shadow: 0 6px 24px rgba(233, 30, 99, 0.4);
}

button[type="submit"]:active {
    transform: scale(0.98);
}

.error {
    margin-top: 1.2rem;
    padding: 0.9rem 1.2rem;
    background: #ffebee;
    color: #c62828;
    border-radius: 0.8rem;
    border-left: 4px solid #e53935;
    font-size: 0.95rem;
}

.result {
    margin-top: 2rem;
    max-width: 520px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.result h2 {
    color: #4a148c;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    text-align: center;
}

.result img {
    width: 100%;
    border-radius: 1.2rem;
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
    border: 3px solid rgba(255, 183, 77, 0.4);
}

.result p {
    text-align: center;
    margin-top: 1rem;
}

.result a {
    display: inline-block;
    padding: 0.7rem 2rem;
    background: linear-gradient(135deg, #66bb6a, #26a69a);
    color: white;
    text-decoration: none;
    border-radius: 3rem;
    font-weight: 700;
    font-size: 1rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 3px 12px rgba(76, 175, 80, 0.3);
}

.result a:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.4);
}
