:root {
    --primary-color: #4f46e5;      /* Indigo 600 */
    --background-color: #f3f4f6;   /* Gray 100 */
    --card-background: #ffffff;
    --text-color: #1f2937;         /* Gray 800 */
    --label-color: #4b5563;        /* Gray 600 */
    --border-color: #e5e7eb;       /* Gray 200 */
    --dark-footer-bg: #111827;     /* Gray 900 */
    --light-text: #d1d5db;         /* Gray 300 */
}

body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--background-color); 
    color: var(--text-color); 
    margin: 0; 
}

code, pre, .font-mono-override {
    font-family: 'Fira Code', monospace;
}

.site-header {
    background: var(--card-background);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1280px; /* max-w-7xl */
    margin: 0 auto;
}

.site-title a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo {
    height: 40px;
    width: auto;
}

.site-nav a {
    margin-left: 1.5rem; /* ml-6 */
    font-weight: 500;
    color: var(--label-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-nav a:hover {
    color: var(--primary-color);
}

.page-hero {
    background-color: #eef2ff; /* Indigo 50 */
    text-align: center;
    padding: 40px 20px;
}

.hero-container {
    width: 90%;
    max-width: 1280px; /* max-w-7xl */
    margin: 0 auto;
}

.page-hero h1 { 
    color: #3730a3; /* Indigo 800 */
    margin: 0 0 10px 0;
    font-size: 2.25rem; /* text-4xl */
    font-weight: 700;
}

.page-hero p { 
    color: var(--label-color); 
    font-size: 1.125rem; /* text-lg */
    margin: 0;
}

.page-content-wrapper {
    padding: 2rem 1rem; /* p-8 on larger, p-4 on smaller */
}

.editor-container {
    position: relative;
    background-color: #f9fafb; /* bg-gray-50 */
}

.highlights {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.5rem 0.75rem; /* px-3 py-2 */
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: auto;
    pointer-events: none;
    /* === FIX: The text in this display layer must be visible === */
    color: var(--text-color); 
}

#test-string {
    position: relative;
    z-index: 1;
    background-color: transparent;
    /* This makes the top typing layer's text invisible, but keeps the cursor */
    color: transparent; 
    caret-color: black;
    -webkit-text-fill-color: transparent; /* For Safari */
}

.highlights mark {
    background-color: rgba(250, 204, 21, 0.5); /* yellow-300 with opacity */
    border-radius: 3px;
    cursor: pointer;
    pointer-events: auto;
    transition: background-color 0.2s ease;
}

.highlights mark:hover {
    background-color: rgba(250, 204, 21, 0.8);
}

.highlights mark.active {
    background-color: rgba(59, 130, 246, 0.6); /* blue-500 with opacity */
}

input[type=range] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 8px; background: #d1d5db;
    border-radius: 5px; outline: none; opacity: 0.7; transition: opacity .2s;
}
input[type=range]:hover { opacity: 1; }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 20px; height: 20px; background: var(--primary-color);
    cursor: pointer; border-radius: 50%; border: 2px solid white;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}
input[type=range]::-moz-range-thumb {
    width: 20px; height: 20px; background: var(--primary-color);
    cursor: pointer; border-radius: 50%; border: 2px solid white;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.site-footer {
    background: var(--dark-footer-bg);
    color: var(--light-text);
    padding: 30px 0;
    margin-top: 50px;
    width: 100%;
}
.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 15px;
}
.footer-nav a {
    margin-left: 20px;
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.2s ease;
}
.footer-nav a:hover {
    color: white;
}