:root {
    --primary: #2c3e50;
    --accent: #3498db;
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #333;
    --border: #e1e4e8;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

h1 {
    font-size: 2.5rem;
    margin: 0;
    color: var(--primary);
    font-family: 'Merriweather', serif; /* Jewish/Academic feel */
}

.subtitle {
    color: #666;
    font-style: italic;
    margin-top: 10px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.95rem;
    line-height: 1.5;
}

.disclaimer-text strong {
    color: #444;
}

.small-note {
    font-size: 0.85rem;
    opacity: 0.8;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary);
}

select, textarea, input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    font-weight: 600;
}

button:hover {
    background-color: #1a252f;
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#output-container {
    display: none;
}

#result {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    min-height: 300px;
    background: #f4f6f8;
}

.persona-desc {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
    }
    
    .action-btn {
        flex: 1;
        min-width: 120px;
        padding: 10px 15px;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    #copy-btn {
        background-color: #7f8c8d;
    }
    
    #copy-btn:hover {
        background-color: #6c7a7d;
}

#gemini-btn {
    background: linear-gradient(135deg, #1a73e8, #8e44ad);
}

#gemini-btn:hover {
    opacity: 0.9;
}
#chatgpt-btn {
    background-color: #10a37f;
}
#chatgpt-btn:hover {
    background-color: #0e906f;
}
#grok-btn {
    background-color: #000000;
    border: 1px solid #333;
}

#grok-btn:hover {
    background-color: #333333;
}
#chatgpt-btn:hover {
    background-color: #0e906f;
}
.instruction-text { text-align: center; margin-top: 10px; font-size: 0.9em; color: #666; }

.suggestion-box {
    margin-top: 5px;
    font-size: 0.9rem;
    color: #cc0000;
    cursor: pointer;
}

.suggestion-link {
    font-weight: bold;
    text-decoration: underline;
    color: var(--accent);
}

.suggestion-link:hover {
    color: #2980b9;
}
.button-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

#generate-btn {
    flex: 2;
}

.cancel-btn {
    flex: 1;
    padding: 12px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cancel-btn:hover {
    background-color: #c0392b;
}
.warning-box {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 0.9em;
    display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .close-warning {
        cursor: pointer;
        font-weight: bold;
        font-size: 1.2em;
        margin-left: 10px;
        color: #856404;
        opacity: 0.7;
    }
    
    .close-warning:hover {
        opacity: 1;
}
/* Sources Table */
.sources-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5px;
    font-size: 0.9rem;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.sources-table th,
.sources-table td {
    border: 1px solid #eee;
    padding: 10px;
    text-align: left;
}

.sources-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e0e0e0;
}

.sources-table tr:hover {
    background-color: #fbfbfb;
}

.sources-table a {
    display: inline-block;
    padding: 4px 10px;
    background-color: #ecf0f1;
    color: #2980b9;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sources-table a:hover {
    background-color: #3498db;
    color: white;
    text-decoration: none;
}

.hebrew-text {
    font-family: 'SBL Hebrew', 'Ezra SIL', 'Times New Roman', serif;
    direction: rtl;
    text-align: right;
    font-size: 1.1em;
    color: #444;
}

/* Badges for Source Types */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background-color: #95a5a6;
    /* Default */
}

.badge.tanakh {
    background-color: #3498db;
}

.badge.mishnah {
    background-color: #e67e22;
}

.badge.talmud {
    background-color: #9b59b6;
}

.badge.midrash {
    background-color: #1abc9c;
}

.badge.halakhah {
    background-color: #e74c3c;
}

.badge.kabbalah {
    background-color: #34495e;
}

.badge.liturgy {
    background-color: #f1c40f;
    color: #444;
}
.disclaimer-card {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.5;
    padding-top: 0;
    margin-top: -1rem;
    text-align: center;
}

.disclaimer-card p {
    margin-bottom: 0.5rem;
}

.small-text {
    font-size: 0.8rem;
    color: #868e96;
}
