/* Variables */
:root {
    --primary-color: #4f46e5;
    --primary-light: #eef2ff;
    --primary-dark: #312e81;
    --text-dark: #333333;
    --text-light: #666666;
    --text-lighter: #888888;
    --bg-gradient-from: #f0f4ff;
    --bg-gradient-to: #e0e7ff;
    --white: #ffffff;
    --border-color: #e5e7eb;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Level colors */
    --level-very-easy: #22c55e;
    --level-easy: #4ade80;
    --level-fairly-easy: #86efac;
    --level-standard: #fcd34d;
    --level-fairly-difficult: #f59e0b;
    --level-difficult: #f97316;
    --level-very-difficult: #ef4444;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(to bottom right, var(--bg-gradient-from), var(--bg-gradient-to));
    min-height: 100vh;
    padding: 1rem;
}

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

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

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

.subtitle {
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.copyright {
    font-size: 0.85rem;
    color: var(--text-lighter);
}

.copyright a {
    color: var(--primary-color);
    text-decoration: none;
}

.copyright a:hover {
    text-decoration: underline;
}

/* Main Application Container */
.app-container {
    display: flex;
    flex-direction: column;
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
}

@media (min-width: 992px) {
    .app-container {
        flex-direction: row;
    }
}

/* Input Section */
.input-section {
    flex: 1;
    padding: 1.5rem;
}

.input-header, .results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.input-header h2, .results-header h2 {
    font-size: 1.25rem;
    color: var(--text-dark);
    font-weight: 600;
}

#clear-button {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.875rem;
    cursor: pointer;
}

#clear-button:hover {
    color: var(--primary-dark);
}

textarea {
    width: 100%;
    height: 250px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    resize: none;
    font-family: inherit;
    font-size: 1rem;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* Results Section */
.results-section {
    background-color: var(--primary-light);
    padding: 1.5rem;
}

@media (min-width: 992px) {
    .results-section {
        width: 320px;
    }
}

#info-button {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
}

#info-button:hover {
    color: var(--primary-dark);
}

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

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

.hidden {
    display: none;
}

/* Score Displays */
.score-display {
    text-align: center;
    margin-bottom: 1.5rem;
}

.score-display h3 {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.score-circle-container {
    display: inline-block;
    padding: 4px;
    border-radius: 50%;
    background-color: #e5e7eb;
}

.score-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #e5e7eb;
    color: var(--white);
    font-weight: 700;
    font-size: 1.25rem;
}

.score-display p {
    margin-top: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

/* Stats Details */
.stats-details {
    margin-top: 1.5rem;
    font-size: 0.875rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.stat-row span:first-child {
    color: var(--text-light);
}

.stat-row span:last-child {
    font-weight: 500;
}

/* Info Panel */
#info-panel {
    background-color: #dbeafe;
    padding: 1.5rem;
    border-top: 1px solid #bfdbfe;
}

.info-section {
    margin-bottom: 2rem;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 0.5rem;
}

.info-section p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.interpretation-guide {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.interpretation-guide h4 {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.interpretation-guide ul {
    list-style: none;
}

.interpretation-guide li {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.level-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.level-very-easy { background-color: var(--level-very-easy); }
.level-easy { background-color: var(--level-easy); }
.level-fairly-easy { background-color: var(--level-fairly-easy); }
.level-standard { background-color: var(--level-standard); }
.level-fairly-difficult { background-color: var(--level-fairly-difficult); }
.level-difficult { background-color: var(--level-difficult); }
.level-very-difficult { background-color: var(--level-very-difficult); }

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
}

footer p {
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 0.25rem;
}

footer a:hover {
    text-decoration: underline;
}
