body {
    font-family: 'Cairo', sans-serif;
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
    text-align: center;
}

h1 {
    color: #007bff;
    margin-bottom: 15px;
}

p {
    color: #666;
    margin-bottom: 25px;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    box-sizing: border-box;
    resize: vertical;
    margin-bottom: 20px;
}

.proxy-selector-container {
    display: none; /* Hide proxy selector since we handle it automatically */
}

.proxy-selector-container label {
    margin-left: 10px;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    box-sizing: border-box;
    background-color: white;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    width: 100%;
    margin-bottom: 20px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 58px; /* Set a minimum height to prevent layout shift */
}

button:hover {
    background-color: #0056b3;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

audio {
    width: 100%;
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

#status-message {
    margin-top: 15px;
    font-weight: bold;
    padding: 10px;
    border-radius: 5px;
    display: none; /* Initially hidden, controlled by JS */
}

#status-message.loading {
    display: block;
    color: #007bff;
    background-color: #e7f3ff;
}

#status-message.error {
    color: #dc3545;
    background-color: #f8d7da;
}

#status-message.success {
    color: #28a745;
    background-color: #d4edda;
}

#status-message.info {
    display: block;
    color: #17a2b8;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
}

#fallback-container {
    margin-top: 20px;
    padding: 15px;
    background-color: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 5px;
    text-align: center;
}

#fallback-container p {
    margin: 0 0 10px 0;
    color: #856404;
}

#fallback-container a {
    display: inline-block;
    background-color: #ffc107;
    color: #212529;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

#fallback-container a:hover {
    background-color: #e0a800;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #fff;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#raw-response-container {
    margin-top: 20px;
    text-align: right;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 5px;
    background-color: #f9f9f9;
    max-height: 400px;
    overflow-y: auto;
}

#raw-response-container h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
}

#raw-response {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: monospace;
    background-color: #eee;
    padding: 15px;
    border-radius: 5px;
    text-align: left;
    direction: ltr;
    font-size: 13px;
    line-height: 1.4;
    border: 1px solid #ccc;
}