body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: white;
}
header {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
header img {
    width: 100%;
    max-width: 840px;
    height: auto;
}
main {
    max-width: 800px;
    padding: 20px;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
    text-align: center;
    color: #333;
}
.explanation {
    margin-bottom: 20px;
    font-size: 1.2em;
    color: #666;
}
form {
    display: flex;
    flex-direction: column;
    align-items: center;
}
input[type="tel"] {
    padding: 10px;
    margin: 10px 0;
    width: 100%;
    max-width: 400px;
    font-size: 1em;
}
input[type="text"] {
    padding: 10px;
    margin: 10px 0;
    width: 100%;
    max-width: 400px;
    font-size: 1em;
}
button {
    padding: 10px 20px;
    font-size: 1em;
    color: white;
    background-color: #4CAF50;
    border: none;
    cursor: pointer;
    margin-top: 10px;
}
button:hover {
    background-color: #45a049;
}

/* Modal styling */
#resultModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
#modalContent {
    background: white;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
#closeModal {
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 10px;
    border-radius: 4px;
}
#closeModal:hover {
    background: #d32f2f;
}

/* Spinner styling */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-bottom: 10px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.councillor-email {
    margin-bottom: 25px;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.councillor-email h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.copy-instructions {
    margin-bottom: 15px;
    padding: 8px;
    background-color: #fff;
    border-left: 3px solid #4CAF50;
    font-size: 0.9em;
}

.copy-email-btn {
    padding: 6px 12px;  /* Match padding with email link */
    margin: 0;  /* Remove margin */
    line-height: 1.2;  /* Control line height */
}

.copy-email-btn:hover {
    background-color: #45a049;
}

.email-link {
    display: inline-block;
    padding: 6px 12px;  /* Reduced padding */
    background-color: #2196F3;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    line-height: 1.2;  /* Control line height */
}

.email-link:hover {
    background-color: #0b7dda;
}

.fallback-section {
    margin-top: 40px;
    padding: 20px;
    border-top: 2px dashed #ccc;
    background-color: #f7f7f7;
}

.fallback-section h2 {
    color: #d32f2f;
    margin-top: 0;
}

.full-email-link {
    display: inline-block;
    padding: 10px 15px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 1em;
    margin: 10px 0;
}

.full-email-link:hover {
    background-color: #45a049;
}

.fallback-councillors {
    margin-top: 20px;
}

.councillor-email.fallback {
    background-color: white;
    border: 1px solid #ddd;
}

.fallback-instructions {
    margin-bottom: 20px;
    padding: 10px;
    background-color: #fff;
    border-left: 3px solid #4CAF50;
    font-size: 0.9em;
}

.fallback-councillor, .fallback-mp {
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.councillor-name, .mp-name {
    padding: 10px 15px;
    background-color: #f0f0f0;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.councillor-name:hover {
    background-color: #e0e0e0;
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.3s;
}

.toggle-active .toggle-icon {
    transform: rotate(180deg);
}

.councillor-actions, .mp-actions {
    padding: 10px;  /* Reduced padding */
    background-color: white;
    display: flex;
    gap: 8px;
    align-items: center;  /* Vertically center items */
}

#resultModal {
    overflow-y: auto;
}

#modalContent {
    margin: 30px auto;
    max-height: 90vh;
    overflow-y: auto;
}

.councillor-links, .mp-result {
    margin-bottom: 30px;
}

.councillor-link {
    display: block;
    margin-bottom: 8px;
}

.mp-result {
    padding-bottom: 15px;
}

.fallback-mps {
    margin-top: 20px;
}