:root {
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary: #ec4899;
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #1e1b4b;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    overflow-x: hidden;
}

/* Background floating elements for dynamic feel */
.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    animation: float 20s infinite alternate;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    opacity: 0.15;
    top: -10%;
    left: -10%;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    opacity: 0.15;
    bottom: -10%;
    right: -5%;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* Container */
.app-container {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

p.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Photo Upload styling */
.photo-upload-container {
    position: relative;
    width: 100%;
    height: 240px;
    border: 2px dashed var(--border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

.photo-upload-container:hover {
    border-color: var(--primary);
    background: var(--surface-hover);
}

.photo-preview {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 10;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.photo-upload-container:hover .upload-icon {
    color: var(--primary);
    transform: scale(1.1);
}

.upload-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

input[type="file"] {
    display: none;
}

/* Overlay for changing photo */
.change-photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 20;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.photo-upload-container:hover .change-photo-overlay {
    transform: translateY(0);
}

/* Number Inputs */
.input-row {
    display: flex;
    gap: 1rem;
}

.input-wrapper {
    position: relative;
    flex: 1;
}

input[type="number"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 3rem 1rem 1rem;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    outline: none;
    font-family: 'Outfit', sans-serif;
}

input[type="number"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

/* Remove arrows from number inputs */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.unit {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 600;
    pointer-events: none;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 1.2rem;
    margin-top: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    font-family: 'Outfit', sans-serif;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
}

.submit-btn:active {
    transform: translateY(1px);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

/* Report Styles */
.report-container {
    margin-top: 3rem;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 20px;
    animation: slideUp 0.6s ease forwards;
}

.report-header {
    margin-bottom: 2rem;
    text-align: center;
}

.report-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.report-divider {
    height: 2px;
    width: 60px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    margin: 0 auto;
}

.report-content {
    line-height: 1.8;
    color: var(--text-main);
}

.report-content h2 {
    font-size: 1.3rem;
    color: var(--secondary);
    margin: 1.5rem 0 1rem 0;
}

.report-content h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin: 1.2rem 0 0.8rem 0;
}

.report-content p {
    margin-bottom: 1rem;
    font-weight: 300;
}

.report-content li {
    margin-bottom: 0.5rem;
    list-style: none;
    padding-left: 1rem;
    position: relative;
    font-weight: 300;
}

.report-content li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* Hairstyle Section */
.hairstyle-section {
    margin-top: 2rem;
    text-align: center;
}

.hairstyle-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.hairstyle-grid-container {
    width: 100%;
    margin: 1.5rem 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.hairstyle-image {
    width: 100%;
    display: block;
    height: auto;
    transition: transform 0.5s ease;
}

.hairstyle-image:hover {
    transform: scale(1.02);
}

.hairstyle-section .caption {
    font-size: 0.9rem;
    color: var(--accent-light);
    opacity: 0.8;
    margin-top: 1rem;
    font-style: italic;
}

.reset-btn {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 1rem;
    border-radius: 12px;
    margin-top: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* Inline Loader */
.loader-inline {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Animation for rendering */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}