/* General Body and Container Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0; /* Changed from 20px to allow full-width banner */
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

/* Main Banner Styles */
.main-banner {
    width: 100%;
    background-color: #e9ecef;
    text-align: center;
    padding: 1.5em 1em;
    border-bottom: 1px solid #dee2e6;
    box-sizing: border-box;
}
.main-banner h1 {
    margin: 0 0 0.25em 0;
    font-size: 2.5em;
    color: #dc3545;
    animation: flash-red 1.5s ease-in-out infinite;
}
.main-banner p {
    margin: 0;
    font-size: 1.1em;
    color: #495057;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.main-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}
.form-column {}
.results-column {}

h1 {
    text-align: center;
    color: #0056b3;
    margin-bottom: 25px;
}

/* --- THIS IS THE FIX --- */
/* The header controls are now positioned absolutely in the top-right corner */
.header-controls { 
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 100; /* Ensure icons are on top of other content */
    display: flex; 
    align-items: center; 
    gap: 16px;
}

/* Language Switcher Styles */
.lang-switcher { 
    position: relative; 
}
#lang-switcher-btn { 
    font-size: 1.8em; 
    background: none; 
    border: none; 
    cursor: pointer; 
    padding: 0; 
}
#lang-menu {
    display: none;
    position: absolute;
    top: 120%;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 150px;
    z-index: 1000;
}
#lang-menu.shown { 
    display: block; 
}
#lang-menu a { 
    display: flex; 
    align-items: center; 
    padding: 0.8em 1em; 
    color: #333; 
    font-size: 1em; 
    text-decoration: none;
}
#lang-menu a:hover { 
    background-color: #f4f4f4; 
    text-decoration: none;
}
.checkmark, .checkmark-placeholder { 
    display: inline-block; 
    width: 20px; 
    text-align: center; 
    font-weight: bold; 
    color: #28a745; 
}

/* Control Section uses CSS Grid */
.controls {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 16px 10px;
    align-items: center;
    background-color: #f0f0f0;
    border-radius: 8px;
    padding: 25px;
}
.controls .step-label {
    grid-column: 1 / 2;
    text-align: right;
    color: #dc3545;
    font-weight: bold;
}
.controls label {
    grid-column: 2 / 3;
    font-weight: bold;
    text-align: right;
}
.form-field {
    display: block;
    grid-column: 3 / 4;
    width: 100%;
    padding: .375rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    box-sizing: border-box;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
select.form-field {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}
.button-container {
    grid-column: 2 / 4;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
}
.controls button {
    padding: 0.5em 1em;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    border: none;
    border-radius: .25rem;
    font-size: 1rem;
    line-height: 1.5;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.controls button:hover { background-color: #0056b3; }

/* Results Display Area */
#results-container { margin-top: 0; }
.service-section { margin-bottom: 25px; border: 1px solid #ddd; padding: 20px; border-radius: 8px; background-color: #fdfdfd; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); }
.service-section h2 { color: #007bff; margin-top: 0; padding-bottom: 5px; margin-bottom: 15px; font-size: 1.5em; }
table { width: 100%; border-collapse: collapse; margin-top: 15px; }
table, th, td { border: 1px solid #e0e0e0; }
th, td { padding: 6px 15px; text-align: left; vertical-align: top; }
th { background-color: #f0f0f0; font-weight: bold; color: #555; text-transform: uppercase; font-size: 0.9em; }
tr:nth-child(even) { background-color: #f9f9f9; }

/* Action Buttons in Table */
.call-btn, .copy-btn { border: none; padding: 6px 12px; border-radius: 5px; cursor: pointer; text-decoration: none; display: inline-block; font-size: 0.9em; font-weight: bold; transition: all 0.2s ease; white-space: nowrap; min-width: 55px; text-align: center; }
.call-btn { background-color: #28a745; color: white; }
.call-btn:hover { background-color: #218838; }
.copy-btn { background-color: #007bff; color: white; }
.copy-btn:hover { background-color: #0056b3; }
.mode-message { font-style: italic; color: #6c757d; font-size: 0.9em; padding: 6px 12px; }

/* Message Banners & Modals */
#action-message { display: none; padding: 1em; margin-bottom: 1.5em; border-radius: 5px; text-align: center; font-weight: bold; color: #856404; background-color: #fff3cd; border: 1px solid #ffeeba; }
.no-results { text-align: center; color: #888; padding: 20px; font-style: italic; background-color: #fff; border-radius: 8px; box-shadow: 0 0 5px rgba(0,0,0,0.05); }
#debug-icon { position: static; font-size: 1.8em; color: #007bff; text-decoration: none; display: none; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); display: none; justify-content: center; align-items: center; z-index: 1001; }
.modal-content { background-color: #fff; padding: 25px; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); position: relative; width: 90%; }
.modal-close { position: absolute; top: 10px; right: 15px; font-size: 28px; font-weight: bold; cursor: pointer; color: #aaa; }
.modal-close:hover, .modal-close:focus { color: #333; }
#debug-modal .modal-content { max-width: 400px; }
#comments-modal .modal-content { max-width: 700px; }
#comments-modal-body .service-section { border: none; box-shadow: none; padding: 0; }
#copy-modal .modal-content { max-width: 500px; text-align: center; }
#copy-modal-input { font-size: 1.5em; font-weight: bold; text-align: center; padding: 0.5em; border: 2px dashed #007bff; margin: 1em 0; width: 100%; box-sizing: border-box; }
#copy-modal-close-btn { margin-top: 1em; }

/* Comment Formatting */
.step-label { color: #dc3545; font-weight: bold; }
.service-section p { margin-bottom: 10px; line-height: 1.8; }
.service-section strong { font-weight: bold; }

/* Responsive adjustments */
@media (max-width: 768px) { .main-content-grid { grid-template-columns: 1fr; } /* ... */ }
@media (max-width: 480px) { /* ... */ }

/* Keyframes for flashing animation */
@keyframes flash-red {
    0% { opacity: 1; }
    50% { opacity: 0.2; }
    100% { opacity: 1; }
}
