:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --border: #e2e8f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text);
    padding: 2rem 1rem;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

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

header h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

main {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

textarea {
    width: 100%;
    height: 150px;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    resize: vertical;
    font-size: 1rem;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.file-drop-area {
    position: relative;
    border: 2px dashed var(--primary);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    background: #f0fdf4;
    cursor: pointer;
}

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

button {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: var(--primary-hover);
}

/* Loading Spinner */
.hidden { display: none !important; }

#loading {
    text-align: center;
    margin: 2rem 0;
}

.spinner {
    border: 4px solid rgba(0,0,0,0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--primary);
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Results Formatting */
#result-section {
    margin-top: 2rem;
    border-top: 2px solid var(--border);
    padding-top: 2rem;
}

.result-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 1rem 0;
}

#ai-feedback {
    line-height: 1.6;
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 8px;
    white-space: pre-wrap; /* Pre-formatted text support */
}