/* Above the fold styles only */
/* This should be inlined in the HTML head for fastest rendering */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    overflow-x: hidden;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.background-animation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    animation: floatAnimation 20s ease-in-out infinite;
}

@keyframes floatAnimation {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(1deg); }
    66% { transform: translateY(10px) rotate(-1deg); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    backdrop-filter: blur(10px);
    animation: containerFadeIn 1s ease-out;
}

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

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 50px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.header h1 img {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
    animation: logoFloat 3s ease-in-out infinite;
}

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

.header p {
    font-size: clamp(1rem, 3vw, 1.2rem);
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

.content {
    padding: 50px 40px;
}

.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 40px;
    text-align: center;
    border-radius: 25px;
    margin: 0 0 50px 0;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.cta-section h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 20px;
}

.cta-section p {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
}

.goal-selection-section {
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.goal-selection-section h3 {
    color: #333;
    margin-bottom: 25px;
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    font-weight: 600;
}

.goal-selection-section p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.goal-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.goal-option {
    background: linear-gradient(135deg, white 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.goal-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.goal-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
}

.goal-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.goal-option-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
    display: block;
}

.goal-option h4 {
    font-size: 1.3em;
    margin-bottom: 10px;
    font-weight: 600;
}

.goal-option p {
    font-size: 0.95em;
    line-height: 1.5;
    opacity: 0.9;
    margin: 0;
}

.goal-option.selected h4,
.goal-option.selected p {
    color: white;
}

.upload-section {
    text-align: center;
    margin-bottom: 60px;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 40px;
    border-radius: 50px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.file-input-wrapper:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.4);
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 100px;
    opacity: 0;
    height: 100%;
    width: 100%;
    cursor: pointer;
}

.loading {
    display: none;
}

.loading.show {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

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

.hidden {
    display: none !important;
}

.error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    border-left: 5px solid #c62828;
    animation: messageSlide 0.5s ease-out;
}

.success {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #2e7d32;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    border-left: 5px solid #2e7d32;
    animation: messageSlide 0.5s ease-out;
}

.info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    border-left: 5px solid #1565c0;
    animation: messageSlide 0.5s ease-out;
}

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

/* Mobile responsiveness for critical styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        padding: 30px 20px;
    }

    .header h1 {
        flex-direction: column;
        gap: 10px;
    }

    .content {
        padding: 30px 20px;
    }

    .cta-section {
        padding: 40px 20px;
    }

    .goal-options {
        grid-template-columns: 1fr;
    }
}

/* Preload animation for better perceived performance */
.preload {
    animation: pulse 2s infinite;
}

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