/* Browser-only Word Embeddings Game Styles */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

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

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 10px;
}

h2 {
    margin-top: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.model-selector {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.model-selector label {
    font-weight: bold;
    margin-right: 10px;
}

.model-selector select {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.model-info {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

.model-info strong {
    color: #333;
}

.formula-input-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
}

.formula-input {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 15px;
}

.formula-input input {
    padding: 8px 12px;
    border: 2px solid #007bff;
    border-radius: 4px;
    font-size: 16px;
    min-width: 100px;
    flex: 1;
    max-width: 140px;
}

.formula-input input:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

.operator,
.equals-sign {
    font-size: 20px;
    font-weight: bold;
    color: #007bff;
    padding: 0 5px;
}

.equals-sign {
    color: #28a745;
}

.example-text {
    text-align: center;
    font-style: italic;
    color: #666;
    margin: 0;
    font-size: 14px;
}

button {
    background-color: #007bff;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: block;
    width: 100%;
    margin-top: 20px;
    transition: background-color 0.3s;
}

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

button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.loading {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
    text-align: center;
}

.loading.hidden {
    display: none;
}

#results ul {
    list-style-type: none;
    padding: 0;
}

#results li {
    background-color: #f8f9fa;
    margin-bottom: 8px;
    padding: 10px 15px;
    border-radius: 4px;
    border-left: 4px solid #007bff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#results li:hover {
    background-color: #e9ecef;
}

.clickable-result {
    cursor: pointer;
    color: #007bff;
    font-weight: bold;
    text-decoration: underline;
    transition: color 0.3s;
}

.clickable-result:hover {
    color: #0056b3;
}

.error-message {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

.embedding-item {
    margin-bottom: 15px;
}

.embedding-item strong {
    display: block;
    margin-bottom: 5px;
    color: #495057;
}

.embedding-item textarea {
    width: 100%;
    height: 60px;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    background-color: #f8f9fa;
    color: #495057;
    resize: vertical;
}

#result-vector-display {
    margin-top: 20px;
}

#resultVector {
    width: 100%;
    height: 60px;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    background-color: #fff;
    color: #495057;
    resize: vertical;
}

#distance-display {
    margin-top: 20px;
}

#distance-display ul {
    background-color: #e7f3ff;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #007bff;
}

#distance-display li {
    margin-bottom: 5px;
}

#distanceInfo {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    margin-top: 10px;
}

/* Responsive design */
@media (max-width: 600px) {
    .container {
        margin: 10px;
        padding: 15px 20px;
    }

    .formula-input {
        flex-direction: column;
        align-items: stretch;
    }

    .formula-input input {
        max-width: none;
        margin: 5px 0;
    }

    .operator,
    .equals-sign {
        text-align: center;
        margin: 5px 0;
    }
    
    .container {
        margin: 10px;
        padding: 15px 20px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }

    .container {
        background-color: #2d2d2d;
        color: #e0e0e0;
    }

    .formula-input-container {
        background-color: #3a3a3a;
        border-color: #4a4a4a;
    }

    .model-selector {
        background-color: #3a3a3a;
        border-color: #4a4a4a;
    }

    #results li {
        background-color: #3a3a3a;
        color: #e0e0e0;
    }

    #results li:hover {
        background-color: #4a4a4a;
    }

    .embedding-item textarea,
    #resultVector {
        background-color: #3a3a3a;
        color: #e0e0e0;
        border-color: #4a4a4a;
    }

    #distanceInfo {
        background-color: #3a3a3a;
        border-color: #4a4a4a;
        color: #e0e0e0;
    }
}

/* Arabic text support */
[lang="ar"], .lang-ar {
    direction: rtl;
    text-align: right;
}

.language-switcher {
    text-align: center;
    margin-bottom: 20px;
}

.lang-btn {
    margin: 0 10px;
    cursor: pointer;
    text-decoration: none;
    color: #0078d7;
}

.lang-btn.active {
    font-weight: bold;
}

.lang-btn:hover {
    text-decoration: underline;
}