* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f6f7;
    color: #495057;
    line-height: 1.6;
}

.top-disclaimer {
    background-color: #e74c3c;
    color: white;
    text-align: center;
    padding: 12px 20px;
    font-weight: 500;
    font-size: 16px;
    width: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

h1 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 36px;
    position: relative;
    display: inline-block;
}

.blue-line {
    width: 100px;
    height: 3px;
    background: #3498db;
    margin: 10px auto 0;
}

.subtitle {
    color: #6c757d;
    font-size: 18px;
}

.search-container {
    display: flex;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    background-color: white;
    border: 1px solid #e0e0e0;
}

#searchInput {
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    border: none;
    outline: none;
}

#searchButton {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

#searchButton:hover {
    background-color: #2980b9;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none;
}

.status-message {
    text-align: center;
    margin-bottom: 20px;
    color: #6c757d;
    font-style: italic;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.reference-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e0e0e0;
    position: relative;
}

.reference-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.reference-header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 20px;
    font-weight: bold;
    font-size: 18px;
    background-image: linear-gradient(135deg, #2c3e50 80%, #34495e);
}

.reference-content {
    padding: 20px;
}

.arabic-text {
    font-family: 'Amiri', serif;
    direction: rtl;
    font-size: 26px;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #000;
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 6px;
    border-right: 4px solid #3498db;
}

.translation {
    font-size: 18px;
    margin-bottom: 20px;
    color: #2c3e50;
    font-style: italic;
    border-left: 3px solid #3498db;
    padding-left: 15px;
    position: relative;
}

.commentary-container {
    position: relative;
    margin-bottom: 25px;
}

.commentary {
    font-size: 16px;
    color: #555;
    line-height: 1.7;
    max-height: 120px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.commentary.expanded {
    max-height: 2000px;
}

.commentary-toggle {
    display: block;
    margin: 10px auto 0;
    color: #3498db;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    padding: 5px 15px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    text-align: center;
    width: fit-content;
}

.commentary-toggle:hover {
    background-color: #edf7ff;
    text-decoration: underline;
}

.commentary-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
    pointer-events: none;
}

.commentary-fade.hidden {
    display: none;
}

.summary {
    background-color: #edf7ff;
    padding: 15px 20px;
    border-radius: 6px;
    font-size: 17px;
    position: relative;
    margin-top: 15px;
    border-left: 3px solid #3498db;
}

.summary.loading {
    background-color: #f0f0f0;
    color: #888;
    min-height: 80px;
}

.summary.loading::after {
    content: "Generating summary...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.error {
    color: #e74c3c;
    text-align: center;
    font-weight: bold;
    padding: 20px;
    background-color: #fdf3f2;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #fadbd8;
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: #6c757d;
    font-size: 14px;
    border-top: 1px solid #e9ecef;
}

.footer-content {
    margin-bottom: 15px;
}

.disclaimer {
    font-size: 12px;
    color: #888;
    max-width: 600px;
    margin: 10px auto 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
    }
    
    #searchInput {
        border-radius: 8px 8px 0 0;
    }
    
    #searchButton {
        border-radius: 0 0 8px 8px;
        padding: 12px;
    }
    
    .arabic-text {
        font-size: 22px;
    }
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    margin: 20px 0 50px;
}

.login-form {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    border: 1px solid #e0e0e0;
}

.login-form h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    text-align: center;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 16px;
    color: #495057;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.login-button {
    width: 100%;
    background-color: #3498db;
    color: white;
    border: none;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

.login-button:hover {
    background-color: #2980b9;
}

.login-button:disabled {
    background-color: #83c2ee;
    cursor: not-allowed;
}

.login-error {
    background-color: #fde2e2;
    color: #e53e3e;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 3px solid #e53e3e;
}

/* Password visibility toggle */
.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.toggle-password:hover {
    color: #3498db;
}

.toggle-password:focus {
    outline: none;
}

.toggle-password .fa-eye,
.toggle-password .fa-eye-slash {
    font-size: 18px;
}

/* Adjust password input padding to prevent text overlapping with the button */
.password-field input[type="password"],
.password-field input[type="text"] {
    padding-right: 40px;
}

/* Make Arabic text in the tafseer bold */
.commentary .arabic-word,
.commentary .arabic,
.commentary [lang="ar"],
.commentary:lang(ar) {
    font-weight: bold;
    font-family: 'Amiri', serif;
}

/* Add an additional style for inline Arabic - we'll add these classes with JavaScript */
.arabic-inline {
    font-weight: bold;
    font-family: 'Amiri', serif;
} 