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

:root {
    --primary-pink: #ff6b9d;
    --primary-purple: #c06bff;
    --dark-bg: #0a0a0f;
    --card-bg: rgba(20, 20, 30, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #b8b8c8;
    --error-color: #ff4d6d;
    --success-color: #4dff88;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a0a2e 50%, #0a0a0f 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background Elements */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.heart-float {
    position: absolute;
    font-size: 2rem;
    opacity: 0.15;
    animation: float 15s infinite ease-in-out;
}

.heart-1 { left: 10%; animation-delay: 0s; animation-duration: 12s; }
.heart-2 { left: 30%; animation-delay: 2s; animation-duration: 15s; }
.heart-3 { left: 50%; animation-delay: 4s; animation-duration: 13s; }
.heart-4 { left: 70%; animation-delay: 1s; animation-duration: 14s; }
.heart-5 { left: 85%; animation-delay: 3s; animation-duration: 16s; }
.heart-6 { left: 20%; animation-delay: 5s; animation-duration: 11s; }

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.15;
    }
    90% {
        opacity: 0.15;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Gradient Orbs */
.gradient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
    animation: drift 20s infinite ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--primary-pink) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--primary-purple) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation-delay: 5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #ff8fab 0%, transparent 70%);
    top: 50%;
    right: 10%;
    animation-delay: 10s;
}

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

/* Container */
.container {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 50px 40px;
    width: 95%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

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

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 10px;
}

.logo-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-purple) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(255, 107, 157, 0.4);
    animation: pulse 3s ease-in-out infinite;
}

.logo-circle svg {
    width: 45px;
    height: 45px;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(255, 107, 157, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(255, 107, 157, 0.6);
    }
}

/* Main Title */
.main-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
}

.gradient-text-alt {
    background: linear-gradient(135deg, var(--primary-purple) 0%, #ff8fab 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
    animation-delay: 1.5s;
}

@keyframes shimmer {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Subtitle */
.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 35px;
    letter-spacing: 0.3px;
}

/* Error Message */
.error-message {
    color: var(--error-color);
    background: rgba(255, 77, 109, 0.1);
    border: 1px solid rgba(255, 77, 109, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: none;
    animation: shake 0.5s ease;
}

.error-message:not(:empty) {
    display: block;
}

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

/* Form Styles */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 18px;
    font-size: 1.2rem;
    color: var(--primary-pink);
    font-weight: 600;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 16px 18px 16px 48px;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-pink);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.1);
    transform: translateY(-2px);
}

/* Button */
.search-button {
    padding: 16px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-purple) 100%);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(255, 107, 157, 0.3);
}

.search-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.search-button:hover::before {
    left: 100%;
}

.search-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(255, 107, 157, 0.5);
}

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

.button-icon {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.search-button:hover .button-icon {
    transform: translateX(4px);
}

/* Loading Spinner */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 30px 0;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.spinner-container {
    position: relative;
    width: 80px;
    height: 80px;
}

.spinner {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary-pink);
    border-right: 4px solid var(--primary-purple);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner-ring {
    position: absolute;
    width: 70px;
    height: 70px;
    top: 5px;
    left: 5px;
    border: 3px solid transparent;
    border-top: 3px solid rgba(192, 107, 255, 0.5);
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}

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

.loading-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.dots {
    display: inline-flex;
    gap: 2px;
}

.dots span {
    animation: blink 1.4s infinite;
}

.dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

.loading-subtext {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.progress-percentage {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse-text 0.8s ease-in-out infinite;
    margin-top: 10px;
}

@keyframes pulse-text {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Meme Section */
.meme-section {
    animation: fadeIn 0.5s ease;
    margin-top: 20px;
}

.meme-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    overflow: hidden;
}


.meme-message h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.meme-message p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
}

.meme-cta {
    color: var(--primary-pink) !important;
    font-weight: 600;
    margin-top: 15px !important;
}

/* Footer */
.footer-note {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-note p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 500px) {
    .container {
        padding: 40px 25px;
        border-radius: 20px;
    }

    .main-title {
        font-size: 2rem;
    }

    .logo-circle {
        width: 70px;
        height: 70px;
    }

    .logo-circle svg {
        width: 40px;
        height: 40px;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .search-input,
    .search-button {
        font-size: 0.95rem;
    }

    .gradient-orb {
        filter: blur(60px);
    }
}

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