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

body {
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.controls {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.selection-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 0.9em;
}

.form-group select,
.form-group input {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    grid-column: 1 / -1;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.translations-panel {
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.translations-panel h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
}

.translations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.translation-checkbox {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background 0.2s;
}

.translation-checkbox:hover {
    background: #e9ecef;
}

.translation-checkbox input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.translation-checkbox label {
    cursor: pointer;
    font-size: 0.95em;
    color: #333;
    user-select: none;
}

.loading {
    padding: 40px;
    text-align: center;
    font-size: 1.2em;
    color: #667eea;
}

.hidden {
    display: none;
}

.comparison-container {
    padding: 30px;
    overflow-x: auto;
}

.comparison-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.comparison-header h2 {
    color: #333;
    font-size: 1.4em;
    margin-bottom: 3px;
}

.comparison-header .reference {
    color: #666;
    font-size: 0.9em;
}

.comparison-content {
    background: white;
    padding: 15px;
    border-radius: 4px;
    max-width: 100%;
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.85em;
    line-height: 1.5;
}

.comparison-table thead {
    background: #667eea;
    color: white;
}

.comparison-table th {
    padding: 8px 6px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    white-space: nowrap;
}

.comparison-table th:first-child {
    width: 35px;
    min-width: 35px;
    text-align: center;
}

.comparison-table td {
    padding: 6px;
    border: 1px solid #e0e0e0;
    vertical-align: top;
    font-size: 0.85em;
    line-height: 1.5;
}

.comparison-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.unit-number {
    font-weight: 700;
    color: #667eea;
    text-align: center;
    font-size: 0.8em;
}

.translation-text {
    color: #1a1a1a;
    font-size: 0.85em;
}

.translation-text.alt-color {
    color: #4a5568;
}

.original-language {
    font-family: 'SBL Hebrew', 'SBL Greek', 'Ezra SIL', 'Galatia SIL', 'Times New Roman', serif;
    font-size: 0.8em;
    direction: rtl;
    text-align: right;
}

.original-language.greek {
    direction: ltr;
    text-align: left;
}

.export-ready {
    background: white;
    padding: 20px;
    font-family: 'Figtree', 'Times New Roman', serif;
    max-width: 100%;
    margin: 0 auto;
}

.export-ready .comparison-table {
    font-size: 0.8em;
}

.export-ready .comparison-table th {
    font-size: 0.75em;
    padding: 6px 4px;
}

.export-ready .comparison-table td {
    font-size: 0.8em;
    padding: 5px 4px;
}

/* Compact styling for Italian poems */
.comparison-table.italian-poems {
    font-size: 0.75em;
    line-height: 1.3;
}

.comparison-table.italian-poems th {
    padding: 4px 6px;
    font-size: 0.7em;
}

.comparison-table.italian-poems td {
    padding: 3px 6px;
    font-size: 0.75em;
    line-height: 1.3;
}

.comparison-table.italian-poems .unit-number {
    font-size: 0.7em;
    width: 25px;
    min-width: 25px;
    padding: 3px 2px;
}

.comparison-table.italian-poems tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.comparison-table.italian-poems hr {
    margin: 2px 0;
    border: none;
    border-top: 1px solid #d0d0d0;
}

.comparison-content.italian-poems {
    padding: 10px;
}

.comparison-container.italian-poems {
    padding: 15px;
}

.comparison-header.italian-poems {
    margin-bottom: 10px;
    padding-bottom: 8px;
}

.comparison-header.italian-poems h2 {
    font-size: 1.2em;
    margin-bottom: 2px;
}

.print-controls {
    padding: 20px 30px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.print-controls .btn-primary {
    grid-column: auto;
    display: inline-block;
    min-width: 150px;
}

@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        border-radius: 0;
    }
    
    header {
        background: #667eea !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .controls {
        display: none;
    }
    
    .print-controls {
        display: none;
    }
    
    .comparison-table {
        page-break-inside: avoid;
    }
    
    .comparison-table thead {
        background: #667eea !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .comparison-table th,
    .comparison-table td {
        border: 1px solid #333;
    }
}

.error-message {
    padding: 20px;
    background: #fee;
    border-left: 4px solid #f00;
    border-radius: 6px;
    color: #c00;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .selection-panel {
        grid-template-columns: 1fr;
    }
    
    .translations-grid {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2em;
    }
}




