/* Global Styles */
:root {
    --bg: #0b0f12;
    --card-bg: #0d1117;
    --text: #e6edf3;
    --muted: #9aa0a6;
    --accent: #0069ff;
    --border-color: rgba(31,37,55,0.6);
}

.light-theme {
    --bg: #f0f2f5; /* A gentle, soft background */
    --card-bg: #ffffff;
    --text: #1f2328; /* Dark, readable text */
    --muted: #656d76;
    --accent: #0969da;
    --border-color: #d0d7de;
}

/* Light-mode fixes */
.light-theme .card h1 { color: var(--text) !important; }
.light-theme .form-check-label { color: var(--text); }


body, html {
    height: 100%;
    margin: 0;
    background-color: var(--bg);
    width: 100%;
    font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 220ms ease, color 220ms ease;
}

/* Container */
.container {
    max-width: 1100px;
    margin: 40px auto;
}

/* Card adjustments */
.card.bg-dark {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color);
    transition: background-color 220ms ease, border-color 220ms ease;
}

/* Header image (logo) - responsive */
.header-img {
    max-width: 64px;
    height: auto;
    display: inline-block;
}

/* Legend container - mobile friendly scroll */
#legendContainer {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
}
#legendContainer button {
    white-space: nowrap;
    min-width: 88px;
    color: white; /* Legend buttons have colored backgrounds */
    border: none;
}

/* Animations */
.fade-in { animation: fadeInUp 0.28s ease both; }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Disable animations when user opts out */
.animations-disabled .fade-in,
.animations-disabled * {
    animation: none !important;
    transition: none !important;
}

/* Adjust textareas and buttons to respect theme variables */
textarea#textInput.form-control {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text);
    min-height: 140px;
    resize: vertical;
    transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease;
}

.light-theme textarea#textInput.form-control {
    background-color: #f6f8fa; /* Slightly off-white for text area */
}

.btn-primary {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #ffffff; /* White text on buttons */
}
.btn-primary:hover {
    filter: brightness(110%);
}

/* Output Box */
.output {
    background-color: var(--bg);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    min-height: 80px;
    text-align: left;
    word-wrap: break-word;
    color: var(--text);
    transition: background-color 220ms ease, border-color 220ms ease, color 220ms ease;
}

/* Word Highlighting */
.highlight {
    padding: 3px 6px;
    border-radius: 6px;
    font-weight: 600;
    margin-right: 4px;
    margin-bottom: 4px;
    display: inline-block;
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.no-box-mode .highlight {
    padding: 0;
    margin: 0;
    border-radius: 0;
    display: inline;
}

/* Responsive */
@media (max-width: 767px) {
    .container { margin: 20px; }
    .header-img { max-width: 40px; height: auto; display: inline-block; margin-right: 10px; }
    #legendContainer { padding: 8px 0; }
}
 