:root {
    --primary-color: #3a506b;
    --secondary-color: #5bc0de;
    --background-color: #f7f9fb;
    --text-color: #333;
    --card-bg-color: #ffffff;
    --border-color: #e0e0e0;
    --font-sans: 'Poppins', sans-serif;
    --font-serif: 'Lora', serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 {
    font-weight: 600;
}

main {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.controls-container {
    background-color: var(--card-bg-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-mode-tabs {
    display: flex;
    background-color: #e9ecef;
    border-radius: 6px;
    padding: 4px;
}

.tab-btn {
    flex: 1;
    padding: 0.65rem;
    border: none;
    background-color: transparent;
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

#search-input, #version-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: border-color 0.3s, box-shadow 0.3s;
}

#search-input:focus, #version-select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(91, 192, 222, 0.25);
}

.radio-group {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.radio-group input[type="radio"] {
    display: none;
}

.radio-group label {
    flex: 1;
    text-align: center;
    padding: 0.65rem;
    margin-bottom: 0;
    border-left: 1px solid var(--border-color);
    background-color: #f8f9fa;
    color: var(--primary-color);
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    font-size: 0.95rem;
    font-weight: 500;
}

.radio-group label:first-of-type {
    border-left: none;
}

.radio-group input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.button-group {
    display: flex;
    justify-content: center;
}

button#search-btn {
    width: 100%;
    max-width: 300px;
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: 4px;
    background-color: var(--secondary-color);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

button#search-btn:hover {
    background-color: #31b0d5;
    transform: translateY(-2px);
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

#results-container {
    background-color: var(--card-bg-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    min-height: 100px;
}

#results-container h2 {
    font-family: var(--font-serif);
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
    font-size: 1.4rem;
}

.placeholder {
    color: #888;
    text-align: center;
    font-style: italic;
}

.error-message {
    color: #d9534f;
    font-weight: 500;
    text-align: center;
}

.result-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.result-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.result-item-reference {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.result-item-verse {
    font-family: var(--font-serif);
    font-style: italic;
    line-height: 1.7;
}

.interpret-btn {
    background-color: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 1rem;
    transition: all 0.3s;
    font-weight: 500;
}

.interpret-btn:hover:not(:disabled) {
    background-color: var(--secondary-color);
    color: white;
}

.interpret-btn:disabled {
    background-color: #e9ecef;
    border-color: #ced4da;
    color: #6c757d;
    cursor: not-allowed;
}

.interpretation-container {
    margin-top: 1rem;
    border-radius: 4px;
}

.interpretation-container p {
    background-color: #eef7f9;
    border-left: 4px solid var(--secondary-color);
    padding: 1rem;
    font-family: var(--font-sans);
    font-style: normal;
    line-height: 1.7;
}

.interpretation-container .error-message {
    background-color: #f8d7da;
    border-left-color: #d9534f;
    padding: 1rem;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-bottom-color: var(--secondary-color);
    border-radius: 50%;
    display: block;
    margin: 1rem auto;
    animation: rotation 1s linear infinite;
}

.loader-small {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-bottom-color: var(--secondary-color);
    border-radius: 50%;
    display: block;
    margin: 0.5rem auto;
    animation: rotation 1s linear infinite;
}

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