:root {
    --primary-darkest: #2e1a4c;
    --primary-dark: #392064;
    --primary-medium: #5c33ad;
    --primary-light: #f0ecf7; 
    --accent-yellow: #fdb015;
    --text-light: #f0ecf7; 
    --text-dark: #2e1a4c;
    --text-medium: #392064;
    --border-color: #d9d3e6; 
    --header-background: #fff; 
    --header-text-color: var(--primary-darkest);
    --quicklinks-bg-grey: #f4f4f8; 
    --header-height: 72px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--primary-light); 
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
body.menu-open { overflow: hidden; }
header {
    background: var(--header-background); 
    color: var(--header-text-color); 
    padding: 0.75rem 1.5rem;
    display: flex; align-items: center; gap: 30px;
    justify-content: center;
    position: sticky; top: 0; z-index: 1001;
    box-shadow: 0 2px 5px rgba(46,26,76,0.1);
    min-height: 72px;
}
.header-left { display: flex; align-items: center; }
.logo { width: 80px; height: auto; object-fit: contain; margin-right: 15px; vertical-align: middle; }
.title-container h1 {
    font-size: 1.6rem; margin: 0; font-weight: 700; color: var(--header-text-color);
}
.title-container h2 {
    font-size: 0.9rem; margin: 0; font-weight: 400; color: var(--header-text-color); opacity: 0.8;
}
@media (max-width: 768px) {
    .title-container h2 {
        display: none !important;
    }
    .logo {
        width: 60px;
    }
}
.menu-toggle {
    display: block; cursor: pointer; z-index: 1002; padding: 10px; margin: -10px;
}
.menu-toggle span {
    display: block; width: 25px; height: 3px;
    background: var(--header-text-color);
    margin: 5px 0; transition: all 0.3s;
}
.menu-toggle.active span:nth-child(1) { transform: rotate(-45deg) translate(-5px, 6px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(45deg) translate(-5px, -6px); }
#mainNav {
    display: block; position: fixed; left: 0; width: 100%;
    background: var(--primary-dark); z-index: 1000;
    max-height: 0; opacity: 0; overflow: hidden;
    transition: max-height 0.4s, opacity 0.3s 0.1s;
}
#mainNav.active { opacity: 1; overflow-y: auto; }
#mainNav ul { list-style: none; padding: 0; margin: 0; }
#mainNav ul li a, #mainNav ul li .dropbtn {
    padding: 12px 20px; color: var(--text-light); text-decoration: none;
    border-bottom: 1px solid var(--primary-medium);
    transition: background 0.2s, color 0.2s;
    font-size: 0.95rem; word-wrap: break-word; line-height: 1.4;
    display: flex; align-items: center;
}
#mainNav ul li a i { margin-right: 8px; min-width: 20px; }
#mainNav ul li .dropbtn { justify-content: space-between; }
.arrow { transition: transform 0.3s; font-size: 0.8em; margin-left: 5px; }
#mainNav ul li a:hover, #mainNav ul li .dropbtn:hover { background: var(--primary-medium); }
#mainNav ul li .dropbtn.active .arrow { transform: rotate(180deg); }
.dropdown-content {
    display: none; background: var(--primary-dark);
}
.dropdown-content.show { display: block; }
.dropdown-content a {
    display: block; padding: 12px 20px 12px 35px !important;
    font-size: 0.9rem !important;
}
.dropdown-content a:last-child { border-bottom: none; }
@media (min-width: 769px) {
    .menu-toggle { display: none; }
    #mainNav {
        display: block !important; position: sticky;
        top: var(--header-height); width: 100%;
        background: var(--primary-dark); height: auto;
        max-height: none !important; opacity: 1 !important; overflow: visible !important;
        z-index: 1002; padding: 0; transition: none;
    }
    #mainNav ul {
        display: flex; flex-direction: row; justify-content: center; align-items: center;
        padding: 0; margin: 0; height: 50px;
    }
    #mainNav ul li { position: relative; border-bottom: none; }
    #mainNav ul li a, #mainNav ul li .dropbtn {
        height: 50px; line-height: 50px;
        border-bottom: none; border-right: 1px solid var(--primary-medium);
        white-space: nowrap; padding: 0 15px; font-size: 0.95rem;
    }
    #mainNav ul li a i { margin-right: 5px; }
    #mainNav ul li a[href="#about"] { display: flex; justify-content: center; align-items: center; padding: 0 10px; }
    #mainNav ul li a[href="#about"] i { font-size: 1.5em; margin-right: 0; }
    #mainNav ul li:last-child a, #mainNav ul li:last-child .dropbtn { border-right: none; }
    #mainNav ul li .dropbtn .arrow { display: inline-block; margin-left: 8px; font-size: 0.7em; }
    #mainNav ul li .dropbtn.active .arrow { transform: rotate(0deg); }
    #mainNav ul li:hover > .dropbtn .arrow { transform: rotate(180deg); }
    .dropdown-content {
        position: absolute; top: 100%; left: 0;
        background: var(--primary-dark); min-width: 260px;
        z-index: 1005; box-shadow: 0 3px 5px rgba(0,0,0,0.2);
        display: none; border-top: 1px solid var(--primary-medium);
    }
    #mainNav ul li:hover > .dropdown-content { display: block; }
    .dropdown-content a {
        padding: 10px 15px; white-space: normal !important; overflow-wrap: break-word;
        word-wrap: break-word; border-bottom: 1px solid var(--primary-medium);
        height: auto; line-height: 1.2; font-size: 0.9rem;
    }
    .dropdown-content a:last-child { border-bottom: none; }
    .dropdown-content a:hover { background: var(--primary-medium); }
}
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    margin-top: 1.5em;
}
@media (max-width: 1024px) {
    .container {
        max-width: 98vw;
        padding: 0 1.5rem;
    }
}
@media (max-width: 768px) {
    .container {
        max-width: 100vw;
        padding: 0 5vw;
    }
}
@media (max-width: 400px) {
    .container {
        padding: 0 2vw;
    }
}

main { flex-grow: 1; }
.quick-links-section { margin-bottom: 2rem; }
.quick-links-box {
    background: var(--quicklinks-bg-grey);
    padding: 1.5rem 1rem; border-radius: 8px;
    box-shadow: 0 4px 8px rgba(46,26,76,0.08);
    width: 90%; max-width: 700px; margin: 0 auto; text-align: center;
}
.quick-links-box h3 { margin: 0 0 1.5rem 0; color: var(--text-dark); font-size: 1.2rem; }
.quick-links-icons-container {
    display: flex; justify-content: center; align-items: flex-start;
    flex-wrap: wrap; gap: 20px;
}
.quick-icon-link {
    display: flex; flex-direction: column; align-items: center;
    text-decoration: none; width: 90px;
}
.icon-square {
    width: 70px; height: 70px; background: var(--primary-medium);
    border-radius: 10px; display: flex; justify-content: center; align-items: center;
    margin-bottom: 8px; transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
}
.icon-square i { font-size: 2em; color: var(--text-light); transition: color 0.3s; }
.icon-label {
    font-size: 0.8rem; color: var(--text-medium); text-align: center; line-height: 1.2;
    transition: color 0.3s, text-shadow 0.3s;
}
.quick-icon-link:hover .icon-square {
    transform: translateY(-3px); box-shadow: 0 4px 10px rgba(46,26,76,0.2);
}
.quick-icon-link:hover .icon-label { text-shadow: 1px 1px 2px rgba(46,26,76,0.3); }
.page-content {
    display: none; padding: 1rem 0;
    animation: fadeIn 0.5s;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.page-content h2 {
    color: var(--primary-darkest); margin-bottom: 1rem; padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-yellow); display: inline-block;
}
.page-content p, .page-content ul, .page-content li {
    margin-bottom: 0.8rem; color: var(--text-medium);
}
.page-content ul { padding-left: 20px; }
.color-sample-list li {
    display: flex; align-items: center; margin-bottom: 0.5rem; font-size: 0.9rem;
}
.color-swatch {
    width: 20px; height: 20px; border-radius: 4px; margin-right: 10px;
    border: 1px solid rgba(0,0,0,0.1);
}
.color-swatch.light-bg { border: 1px solid #ccc; }
.about-list-icons {
    list-style: none;
    padding-left: 0;
}
.about-list-icons li {
    margin-bottom: 0.7em;
    color: var(--text-medium);
    font-size: 1em;
    display: flex;
    align-items: center;
}
.about-list-icons i {
    margin-right: 8px;
}
.about-checklist {
    list-style: none;
    padding-left: 0;
}
.about-checklist li {
    margin-bottom: 0.7em;
    color: var(--text-medium);
    font-size: 1em;
    display: flex;
    align-items: center;
}
.about-checklist input[type="checkbox"] {
    accent-color: var(--primary-medium);
    margin-right: 8px;
    width: 1.1em;
    height: 1.1em;
}

/* === Theme text styles === */
.theme-text-title { font-size: 2rem; font-weight: 700; color: var(--primary-darkest); }
.theme-text-subtitle { font-size: 1.2rem; font-weight: 600; color: var(--primary-medium); }
.theme-text-muted { color: #999; }
.theme-text-link { color: var(--primary-medium); text-decoration: underline; }
.theme-text-link:hover { color: var(--accent-yellow);}
.theme-text-underline { text-decoration: underline; }
.theme-text-strike { text-decoration: line-through; color: #b18fd6; }
.theme-text-blockquote {
	border-left: 4px solid var(--primary-medium);
    background: #ede7f6;
    color: var(--primary-dark);
    padding: 0.7em 1em;
    margin: 1em 0;
    font-style: italic;
}
.theme-text-code {
	font-family: 'Fira Mono', monospace;
/*	background: #ece7ff; */
	background: #fff6e0;
	color: var(--primary-darkest);
	padding: 0.1em 0.4em;
	border-radius: 4px;
    font-size: 1em;
}
.theme-text-pre {
	background: #282042;
	color: #ffe;
	font-family: 'Fira Mono', monospace;
	padding: 1em;
	border-radius: 6px;
	overflow-x: auto;
	margin: 1em 0;
	font-size: 0.95em;
}
.theme-text-warning {
	background: #fff6e0;
	color: #a67800;
	padding: 0.7em 1em;
	border-left: 5px solid var(--accent-yellow);
	border-radius: 5px;
	margin: 1.2em 0;
}
.theme-text-info {
	background: #f0ecf7;
	color: var(--primary-darkest);
	padding: 0.7em 1em;
	border-left: 5px solid var(--primary-medium);
	border-radius: 5px;
	margin: 1.2em 0;
}
.theme-text-success {
	background: #e7fbe9;
	color: #246e3a;
	padding: 0.7em 1em;
	border-left: 5px solid #4ecb6b;
	border-radius: 5px;
	margin: 1.2em 0;
}
.theme-text-error {
	background: #fbe7e7;
	color: #a12a2a;
	padding: 0.7em 1em;
	border-left: 5px solid #d84b4b;
	border-radius: 5px;
	margin: 1.2em 0;
}

/* === Theme Table Style === */
.theme-table-container {
    overflow-x: auto; /* Enables horizontal scrolling for wide tables on small screens */
    margin-top: 1em; /* Adds some space above the table container */
    margin-bottom: 1.5rem; /* Consistent with .quick-links-section */
    border: 1px solid var(--border-color); /* Subtle border around the container */
    border-radius: 6px; /* Rounded corners, consistent with .theme-text-pre */
    box-shadow: 0 2px 5px rgba(46, 26, 76, 0.08); /* Soft shadow, similar to .quick-links-box */
    background-color: var(--header-background); /* Ensures a background for the container, useful if table itself has transparent parts */
}

.theme-table {
    width: 100%;
    border-collapse: collapse; /* Removes default spacing between cells */
    font-size: 0.9rem; /* Consistent with other secondary text elements */
    color: var(--text-dark); /* Default text color for table content */
}

.theme-table th,
.theme-table td {
    padding: 12px 15px; /* Comfortable padding for cells */
    text-align: left;
    line-height: 1.4; /* Good readability */
    border-bottom: 1px solid var(--border-color); /* Horizontal lines between rows */
}

.theme-table th {
    background-color: var(--primary-medium); /* Uses a primary theme color for headers */
    color: var(--text-light); /* Light text on a dark background for contrast */
    font-weight: 600; /* Makes header text bolder, similar to .theme-text-subtitle */
    /* Optional: Add a distinct bottom border to the header, similar to .page-content h2 */
    /* border-bottom: 2px solid var(--accent-yellow); */
}

/* Zebra striping for table body rows for better readability */
.theme-table tbody tr:nth-child(even) {
    background-color: var(--primary-light); /* Light theme color for alternate rows */
}

.theme-table tbody tr:nth-child(odd) {
    background-color: var(--header-background); /* Typically white or a very light base */
}

/* Hover effect for table body rows */
.theme-table tbody tr:hover {
    background-color: #e9e4f0; /* A slightly darker shade than primary-light for hover, provides feedback */
    color: var(--primary-darkest); /* Ensure text remains readable on hover */
}

/* Remove bottom border from the last row in the table body */
.theme-table tbody tr:last-child td {
    border-bottom: none;
}

/* Style for table caption if you use one */
.theme-table caption {
    caption-side: bottom; /* Positions caption below the table */
    padding: 10px;
    font-size: 0.85rem;
    color: var(--text-medium);
    text-align: center;
    margin-top: 5px;
}

/* === Theme Form Style === */
.theme-form-group {
    margin-bottom: 1.25rem; /* Consistent spacing */
}

.theme-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 600; /* Make labels stand out a bit */
    font-size: 0.9rem;
    line-height: 1.4;
}

.theme-input,
.theme-textarea,
.theme-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px; /* Consistent with .color-swatch, .theme-text-code */
    background-color: var(--header-background); /* Typically white */
    color: var(--text-dark);
    font-family: 'Open Sans', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-sizing: border-box; /* Ensure padding and border are included in width/height */
}

.theme-input:focus,
.theme-textarea:focus,
.theme-select:focus {
    border-color: var(--primary-medium);
    box-shadow: 0 0 0 3px rgba(92, 51, 173, 0.2); /* Subtle focus ring using primary color */
    outline: none;
}

.theme-textarea {
    min-height: 120px;
    resize: vertical; /* Allow vertical resizing */
}

.theme-select {
    appearance: none; /* Remove default system appearance */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23392064'%3E%3Cpath d='M8 10.75L2.5 5.25h11L8 10.75z'/%3E%3C/svg%3E"); /* Custom arrow using text-medium color */
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 1em;
    padding-right: 35px; /* Make space for the arrow */
}

/* Styling for Checkbox and Radio groups */
.theme-checkbox-group,
.theme-radio-group {
    margin-top: 0.5rem;
}

.theme-checkbox-label,
.theme-radio-label {
    display: flex;
    align-items: center;
    margin-bottom: 0.6rem;
    color: var(--text-medium);
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 400; /* Normal weight for these labels */
}

.theme-checkbox-label input[type="checkbox"],
.theme-radio-label input[type="radio"] {
    accent-color: var(--primary-medium); /* Already in your CSS but good to reinforce */
    margin-right: 8px;
    width: 1.2em; /* Slightly larger for better touch target */
    height: 1.2em;
    flex-shrink: 0; /* Prevent shrinking in flex container */
}

/* Button Styles */
.theme-button {
    display: inline-block;
    background-color: var(--primary-medium);
    color: var(--text-light);
    padding: 10px 20px;
    border: 1px solid var(--primary-medium);
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, transform 0.1s ease-in-out;
    line-height: 1.5;
}

.theme-button:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px); /* Subtle lift */
}

.theme-button:active {
    background-color: var(--primary-darkest);
    border-color: var(--primary-darkest);
    transform: translateY(0px);
}

/* Secondary Button Style */
.theme-button-secondary {
    background-color: var(--quicklinks-bg-grey);
    color: var(--primary-dark);
    border: 1px solid var(--border-color);
}

.theme-button-secondary:hover {
    background-color: var(--border-color);
    border-color: #c4b9d9; /* Slightly darker border on hover */
    color: var(--primary-darkest);
}

.theme-button-secondary:active {
    background-color: #c4b9d9;
    border-color: #b1a3cc;
}

/* Accent Button Style (using accent-yellow) */
.theme-button-accent {
    background-color: var(--accent-yellow);
    color: var(--primary-darkest); /* Dark text for yellow bg */
    border-color: var(--accent-yellow);
}

.theme-button-accent:hover {
    background-color: #e49c00; /* Darker yellow */
    border-color: #e49c00;
    color: var(--primary-darkest);
}

.theme-button-accent:active {
    background-color: #c68600;
    border-color: #c68600;
}

/* Fieldset and Legend */
.theme-fieldset {
    border: 1px solid var(--border-color);
    padding: 1.5rem 1.5rem 1rem 1.5rem; /* More padding inside */
    border-radius: 6px; /* Consistent with .theme-text-pre */
    margin-bottom: 1.5rem;
}

.theme-legend {
    padding: 0 0.75em; /* Space around legend text */
    font-weight: 700; /* Bold legend */
    color: var(--primary-darkest);
    font-size: 1.1rem; /* Slightly larger than labels */
    margin-left: -0.75em; /* Align with padding of fieldset if possible or adjust as needed */
}

/* Helper and Error Text */
.theme-form-help {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: var(--text-medium);
    line-height: 1.3;
}

.theme-form-error-message {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: #a12a2a; /* From .theme-text-error */
    font-weight: 600;
    line-height: 1.3;
}

.theme-input.is-invalid,
.theme-textarea.is-invalid,
.theme-select.is-invalid {
    border-color: #d84b4b; /* From .theme-text-error border */
}

.theme-input.is-invalid:focus,
.theme-textarea.is-invalid:focus,
.theme-select.is-invalid:focus {
    border-color: #d84b4b;
    box-shadow: 0 0 0 3px rgba(216, 75, 75, 0.25); /* Error focus ring */
}

/* For grouping buttons */
.theme-form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem; /* Spacing between buttons */
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

footer {
    background: var(--primary-darkest); color: var(--text-light);
    text-align: center; padding: 1rem; font-size: 0.9rem;
}

