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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #7dd3fc 0%, #3b82f6 100%);
    min-height: 100vh;
    padding: 2rem;
    color: #fff;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(96, 165, 250, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.3) 0%, transparent 50%);
    pointer-events: none;
    animation: pulse 8s ease-in-out infinite;
}

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

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

.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

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

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    animation: rotate 10s linear infinite;
}

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

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
}

.upload-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

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

.file-input-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

.file-label:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.3);
}

.upload-icon {
    margin-bottom: 1rem;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.file-label:hover .upload-icon {
    transform: translateY(-8px);
    opacity: 1;
}

.file-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.file-subtext {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.selected-file {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.selected-file svg {
    flex-shrink: 0;
    opacity: 0.9;
}

.question-section {
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.question-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #fff;
}

.question-label svg {
    opacity: 0.9;
}

#question {
    width: 100%;
    padding: 1.25rem 1.5rem;
    font-size: 1.125rem;
    font-family: inherit;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    resize: vertical;
    min-height: 140px;
    transition: all 0.3s ease;
    line-height: 1.6;
}

#question::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#question:focus {
    outline: none;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
}

.user-question {
    padding: 1rem 1.25rem;
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    color: #374151;
    font-size: 0.95rem;
}

.btn-analyze {
    width: 100%;
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    position: relative;
    overflow: hidden;
}

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

.btn-analyze:hover::before {
    left: 100%;
}

.btn-analyze:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.6);
}

.btn-analyze:active {
    transform: translateY(0);
}

.btn-analyze svg {
    transition: transform 0.3s ease;
}

.btn-analyze:hover svg {
    transform: translateX(4px);
}

.spinner {
    display: inline-block;
}

.spinner-circle {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.alert {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    animation: shake 0.5s ease-out;
}

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

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fff;
}

.results-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.8s ease-out;
}

.results-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.results-title svg {
    color: #10b981;
}

.results-content {
    color: #374151;
    font-size: 1rem;
    line-height: 1.8;
}

.formatted-response {
    line-height: 1.8;
}

.formatted-response strong {
    color: #1f2937;
    font-weight: 700;
    font-size: 1.05em;
    background: linear-gradient(120deg, #3b82f6 0%, #1d4ed8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.formatted-response em {
    color: #4b5563;
    font-style: italic;
}

.response-paragraph {
    margin: 0.75rem 0;
    color: #374151;
    line-height: 1.7;
}

.section-header {
    color: #3b82f6;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3b82f6;
    text-transform: capitalize;
    background: linear-gradient(120deg, #3b82f6 0%, #1d4ed8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header:first-child {
    margin-top: 0;
}

.list-item {
    display: flex;
    align-items: flex-start;
    margin: 0.75rem 0;
    padding-left: 1rem;
    line-height: 1.6;
    background: rgba(59, 130, 246, 0.03);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.list-item:hover {
    background: rgba(59, 130, 246, 0.08);
    transform: translateX(4px);
}

.list-item.bullet {
    padding-left: 0.75rem;
}

.list-number {
    color: #3b82f6;
    font-weight: 700;
    margin-right: 0.75rem;
    min-width: 2rem;
    flex-shrink: 0;
    font-size: 1.1em;
}

.bullet-point {
    color: #3b82f6;
    font-weight: 700;
    margin-right: 0.75rem;
    font-size: 1.2em;
    flex-shrink: 0;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    animation: fadeInUp 0.8s ease-out;
}

.feature-card:nth-child(1) { animation-delay: 0.3s; }
.feature-card:nth-child(2) { animation-delay: 0.4s; }
.feature-card:nth-child(3) { animation-delay: 0.5s; }

.feature-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .logo h1 {
        font-size: 1.75rem;
    }

    .upload-section {
        padding: 2rem;
    }

    .file-label {
        padding: 2rem;
    }

    .results-section {
        padding: 1.5rem;
    }

    .features {
        grid-template-columns: 1fr;
    }
}