:root {
    --primary-color: #1976d2;
    --primary-light: #63a4ff;
    --primary-dark: #004ba0;
    --on-primary: #ffffff;

    --surface-color: #ffffff;
    --background-color: #f5f5f5;
    --text-color: #333333;
    --text-secondary: #666666;

    --shadow-1: 0 2px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 0 rgba(0, 0, 0, 0.12);
    --shadow-2: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 2rem;
}

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

a:hover {
    text-decoration: underline;
}

small {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Header */
header {
    background-color: var(--primary-color);
    color: var(--on-primary);
    padding: 1.5rem 0;
    box-shadow: var(--shadow-2);
    margin-bottom: 2rem;
}

header h1 {
    font-weight: 500;
    font-size: 1.5rem;
}

header small {
    color: rgba(255, 255, 255, 0.8);
}

header a {
    color: white;
    font-weight: 500;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Card */
.card {
    background-color: var(--surface-color);
    border-radius: 4px;
    box-shadow: var(--shadow-1);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-2);
}

.card-content {
    padding: 1.5rem;
}

.subtitle {
    display: block;
    margin-bottom: 1rem;
}

/* Sample Message Pre block */
#samplemsg {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    color: #444;
    border: 1px solid #eee;
}

/* Inputs */
textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.2s;
    outline: none;
    margin-bottom: 1rem;
    display: block;
}

textarea:focus {
    border-color: var(--primary-color);
}

.btn-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--on-primary);
    box-shadow: var(--shadow-1);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: var(--shadow-2);
}

.btn-text {
    background-color: transparent;
    color: var(--primary-color);
}

.btn-text:hover {
    background-color: rgba(25, 118, 210, 0.08);
    /* Primary color with low opacity */
}

/* Results Area */
#resultsArea {
    margin-top: 1rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

#resultsArea h3 {
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Details/Summary Styling for Parsed Results */
details {
    margin-bottom: 0.5rem;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
}

details>summary {
    padding: 0.75rem 1rem;
    background-color: #fafafa;
    cursor: pointer;
    list-style: none;
    /* Remove default marker */
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
}

details>summary::-webkit-details-marker {
    display: none;
}

/* Add custom chevron */
details>summary::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid var(--text-secondary);
    margin-right: 10px;
    transition: transform 0.2s;
}

details[open]>summary::before {
    transform: rotate(90deg);
}

details>summary:hover {
    background-color: #f0f0f0;
}

details>div {
    padding: 1rem;
    background-color: white;
    border-top: 1px solid #eee;
}

/* Nested details */
details details {
    border: none;
    border-left: 2px solid #eee;
    margin-left: 0.5rem;
    border-radius: 0;
    margin-bottom: 0;
}

details details>summary {
    background-color: white;
    font-weight: normal;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

details details>summary:hover {
    background-color: #fafafa;
}

details details>div {
    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
    border-top: none;
}

.instructions {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    /* Overlap border */
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary-color);
    background-color: rgba(25, 118, 210, 0.04);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.tab-view {
    display: none;
}

.tab-view.active {
    display: block;
}

/* Ensure textarea in batch view looks good */
#batchArea {
    background-color: #fafafa;
}

/* Remove Button */
.btn-remove {
    background: none;
    border: none;
    color: #e57373;
    /* Soft red */
    cursor: pointer;
    margin-left: 8px;
    padding: 0px 6px;
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-remove:hover {
    background-color: #ffebee;
    color: #d32f2f;
}