* {
    box-sizing: border-box;
    max-width: 100%;
}

html, body {
    width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    max-width: 100%;
    margin: 0 auto;
    padding: 16px;
    background-color: #f7f7f7;
    overflow-x: hidden;
    box-sizing: border-box;
}

h1, h2 {
    font-size: 1.8rem;
    text-align: center;
}

form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

input[type="text"] {
    padding: 16px;
    font-size: 1.2rem;
    width: 100%;
    border-radius: 8px;
    border: 1px solid #ccc;
}

button {
    padding: 16px;
    font-size: 1.2rem;
    border: none;
    border-radius: 8px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
}

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

.error {
    color: red;
    font-size: 1.1rem;
    text-align: center;
    margin-top: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
    table-layout: fixed;
    word-wrap: break-word;
    max-width: 100%;
}

th, td {
    border: 1px solid #ccc;
    padding: 12px;
    text-align: left;
    font-size: 1rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
    word-break: break-word;
}

th {
    background-color: #e9ecef;
}

.button-group {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-success {
    background-color: #28a745;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger:hover {
    background-color: #c82333;
}

.analysis-section {
    margin-top: 24px;
    padding: 16px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 100%;
    overflow-wrap: break-word;
}

.analysis-section h3 {
    margin-top: 0;
    font-size: 1.4rem;
}

.analysis-content {
    font-size: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
    overflow-wrap: break-word;
}

.language-selector {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.language-selector select {
    padding: 8px 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: white;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.language-selector select:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0,123,255,0.1);
}

.language-selector select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.language-selector select option {
    padding: 8px;
    font-size: 1rem;
}

.loading-spinner {
    text-align: center;
    margin: 20px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.debug-section {
    margin-top: 24px;
    padding: 16px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 0 6px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}

.debug-section h3 {
    margin-top: 0;
    font-size: 1.4rem;
    color: #495057;
}

.debug-section pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    padding: 12px;
    border-radius: 4px;
    overflow-y: visible;
    width: 100%;
    box-sizing: border-box;
}

.debug-section pre::-webkit-scrollbar {
    width: 8px;
}

.debug-section pre::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.debug-section pre::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.debug-section pre::-webkit-scrollbar-thumb:hover {
    background: #555;
}
