:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);

    box-shadow: var(--shadow);
}

#mainContent {
    padding: 24px;
    background: var(--card-bg);
}

#controls {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 0 24px 24px 24px;
    box-shadow: var(--shadow);
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
    color: var(--text-color);
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

textarea {
    display: block;
    width: 100%;
    height: 120px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    resize: none;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    ring: 2px solid var(--primary-color);
}

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

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

button:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.secondary-button {
    background-color: #e5e7eb;
    color: #111827;
}

.secondary-button:hover {
    background-color: #d1d5db;
}

.share-button {
    display: none;
    margin-bottom: 12px;
}

.share-button.active {
    display: block;
}

/* Result Section */
#result {
    padding-top: 20px;
    /*border-top: 1px solid #e5e7eb;*/
    display: none;
}

#result.active {
    display: block;
}

.color-preview {
    width: 100%;
    height: 150px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.5s ease;
}

.scores {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.score-item {
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    background-color: #f9fafb;
}

.score-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.score-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
}

.summary-box {
    background-color: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    padding: 16px;
    font-size: 0.95rem;
    color: #1e40af;
    line-height: 1.6;
}

.share-source {
    margin-bottom: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
}

/* Loading Spinner */
.loading {
    display: none;
    justify-content: center;
    margin-top: 20px;
}

.loading.active {
    display: flex;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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