* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --accent: #f093fb;
    --success: #2ed573;
    --warning: #ffa502;
    --danger: #ff4757;
    --dark: #2f3542;
    --gray: #747d8c;
    --light: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 20px 60px rgba(0,0,0,0.15);
    --shadow-sm: 0 4px 20px rgba(0,0,0,0.08);
    --radius: 20px;
    --radius-sm: 12px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 850px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: slideUp 0.6s ease;
}

/* Animated Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 50px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: pulse 4s ease-in-out infinite;
}

.header-icon {
    font-size: 60px;
    margin-bottom: 15px;
    animation: bounce 2s ease infinite;
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: 2.8em;
    margin-bottom: 12px;
    font-weight: 800;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header p {
    font-size: 1.15em;
    opacity: 0.95;
    max-width: 500px;
    margin: 0 auto 20px;
    position: relative;
    z-index: 1;
}

.header-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.9em;
    font-weight: 500;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255,255,255,0.3);
}

/* Search Section */
.search-section {
    padding: 50px 40px;
    background: var(--light);
    position: relative;
}

.search-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-label {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 5px;
}

.input-wrapper {
    position: relative;
}

textarea {
    width: 100%;
    padding: 24px;
    border: 2px solid #e8e8e8;
    border-radius: var(--radius-sm);
    font-size: 16px;
    resize: vertical;
    min-height: 140px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    box-shadow: var(--shadow-sm);
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), var(--shadow-sm);
    transform: translateY(-2px);
}

textarea::placeholder {
    color: #b0b0b0;
    font-style: italic;
}

.input-hint {
    margin-top: 10px;
    font-size: 0.9em;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Beautiful Button */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 20px 50px;
    font-size: 1.15em;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.btn-primary::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;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1.3em;
    animation: wiggle 2s ease infinite;
}

.btn-arrow {
    transition: transform 0.3s;
}

.btn-primary:hover .btn-arrow {
    transform: translateX(5px);
}

/* Loading Section */
#loading {
    padding: 80px 40px;
    text-align: center;
    background: white;
}

.spinner-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 4px solid #f0f0f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid transparent;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 2s linear infinite reverse;
}

.loading-text {
    color: var(--primary);
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 20px;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

/* Results Section */
#results {
    padding: 40px;
    background: white;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.section-header h2 {
    color: var(--dark);
    font-size: 1.5em;
    font-weight: 700;
}

.result-count {
    background: var(--primary);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .header, .search-section, #results {
        padding: 30px 25px;
    }
    
    .header h1 {
        font-size: 2.2em;
    }
    
    .btn-primary {
        padding: 18px 30px;
        font-size: 1em;
    }
}