/* Base font size */
html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html {
    position: relative;
    min-height: 100%;
}

/* Body */
body {
    direction: ltr;
    text-align: left;
    min-height: 100%;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

/* Main container to push footer down */
.container {
    flex: 1 0 auto;
    padding-bottom: 2rem;
}

main {
    min-height: calc(100vh - 200px);
}

/* Fonts */
@font-face {
    font-family: 'Avva_Shenouda';
    src: url('/fonts/Avva_Shenouda.ttf') format('truetype');
}

@font-face {
    font-family: 'Abraam';
    src: url('/fonts/Abraam.ttf') format('truetype');
}

/* Header */
.header-bar {
    background-color: #0072c6;
    padding: 15px 20px;
    text-align: center;
    border-radius: 12px;
    margin: 15px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
}

    .header-bar h2, .header-title {
        font-family: 'Avva_Shenouda', sans-serif;
        font-size: 22px;
        font-weight: bold;
        color: #fff;
        margin: 0;
    }
    .header-bar h2, .dictionary-header-title {
        font-family: Arial, sans-serif;
        font-size: 22px;
        font-weight: bold;
        color: #fff;
        margin: 0;
    }

.header-label {
    font-size: 20px;
    font-family: 'Avva_Shenouda', sans-serif;
    font-weight: bold;
    color: white;
    text-align: center;
}

.header-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* Cards grid with RTL support */
.coptic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

/* Card styling - Bilingual Support */
.coptic-card {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    direction: ltr;
}

/* LTR (English) - Button on left, text on right */
[dir="ltr"] .coptic-card {
    flex-direction: row-reverse;
}

/* RTL (Arabic) - Button on right, text on left */
[dir="rtl"] .coptic-card {
    flex-direction: row;
}

.coptic-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Card labels and buttons */
.coptic-label {
    font-size: 22px;
    font-family: 'Avva_Shenouda', sans-serif;
    font-weight: bold;
    color: #213142;
    margin: 0;
    text-align: right;
    flex: 1;
}
.dictionary-coptic-label {
    font-size: 22px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    color: #213142;
    margin: 0;
    text-align: center !important;
    flex: 1;
}

/* LTR text alignment */
[dir="ltr"] .coptic-label {
    text-align: left;
}

/* RTL text alignment */
[dir="rtl"] .coptic-label {
    text-align: right;
}

.coptic-btn {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: #7baae6;
    font-size: 24px;
    font-family: 'Avva_Shenouda', sans-serif;
    font-weight: bold;
    color: #213142;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* LTR button margin */
[dir="ltr"] .coptic-btn {
    margin-right: 15px;
}

/* RTL button margin */
[dir="rtl"] .coptic-btn {
    margin-left: 15px;
}

/* Card body bilingual flex direction */
[dir="ltr"] .card-body {
    text-align: left;
}

[dir="rtl"] .card-body {
    text-align: right;
}
/* Tables */
.coptic-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    direction: rtl;
    text-align: center;
}

    .coptic-table th, .coptic-table td {
        border: 1px solid #ccc;
        padding: 10px;
        font-size: 18px;
    }

    .coptic-table th {
        background-color: #0072c6;
        color: white;
        font-weight: bold;
    }

/* Special table column widths */
.table td:first-child {
    width: 90px;
    white-space: nowrap;
    text-align: right;
    padding-right: 5px;
}

[dir="ltr"] .table td:first-child {
    text-align: left;
}

[dir="rtl"] .table td:first-child {
    text-align: right;
}
.table td:last-child {
    width: auto;
    padding-left: 5px;
}

[dir="ltr"] .table td:last-child {
    text-align: left;
}

[dir="rtl"] .table td:last-child {
    text-align: right;
}

/* Text styles */
.coptic-text, .coptic-intro, .coptic-arabic-text, .intro-coptic-label {
    font-family: 'Avva_Shenouda', sans-serif;
    font-weight: bold;
    color: #213142;
}

.coptic-intro {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: right;
}

[dir="ltr"] .coptic-intro {
    text-align: left;
}

[dir="rtl"] .coptic-intro {
    text-align: right;
}

.coptic-arabic-text {
    font-size: 20px;
    margin-bottom: 8px;
}

.intro-coptic-label {
    font-size: 22px;
    margin: 5px 0 15px 0;
}

/* Text content alignment */
[dir="ltr"] .table p {
    text-align: left;
}

[dir="rtl"] .table p {
    text-align: right;
}

/* Arabic / Coptic heading labels */
.coptic-h-label {
    font-size: 22px;
    font-family: 'Avva_Shenouda', sans-serif;
    font-weight: bold;
    color: #213142;
}

.coptic-a-label {
    font-size: 22px;
    font-family: 'Avva_Shenouda';
    font-weight: bold;
    color: #213142;
}

.arabic-label {
    font-size: 22px;
    font-family: 'Avva_Shenouda';
    color: #213142;
    direction: rtl;
}

/* Rule cards */
.rule-card {
    border-radius: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease-in-out;
    cursor: pointer;
    overflow: hidden;
}

    .rule-card:hover {
        transform: scale(1.03);
    }

    .rule-card .card-header {
        background-color: #0072c6;
        color: white;
        font-weight: bold;
        font-size: 18px;
        text-align: center;
        font-family: 'Avva_Shenouda';
        border-top-left-radius: 1rem;
        border-top-right-radius: 1rem;
    }

/* Translator page input */
.coptic-entry {
    font-family: 'Avva_Shenouda', monospace;
    font-size: 22px;
    font-weight: bold;
}

.non-coptic-entry {
    font-family: Arial, sans-serif;
    font-size: 22px;
    font-weight: bold;
}

/* Keyboard */
.keyboard {
    display: flex;
    flex-direction: column;
    user-select: none;
    gap: 5px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.keyboard-key {
    flex: 1 1 0;
    min-width: 40px;
    padding: 12px 0;
    border-radius: 5px;
    border: 1px solid #dfe2e4;
    background-color: #fbfbfc;
    text-align: center;
    cursor: pointer;
    font-size: 2rem;
    font-family: 'Avva_Shenouda', sans-serif;
    transition: background-color 0.2s;
}

    .keyboard-key:hover {
        background-color: #e0e0e0;
    }

    .keyboard-key.special {
        background-color: #dfe2e4;
        flex: 1.5 1 0;
    }

    .keyboard-key.ok {
        background-color: #5cb5ab;
        color: white;
        flex: 1.5 1 0;
    }

/* Indents */
.indent {
    text-indent: 20px;
}

.indentC {
    text-indent: 30px;
}

.indent2 {
    text-indent: 50px;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .coptic-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .coptic-card {
        padding: 12px 14px;
    }

    .coptic-label, .coptic-btn {
        font-size: 20px;
    }

    .coptic-intro, .coptic-arabic-text {
        font-size: 16px;
    }

    .coptic-entry {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .coptic-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .coptic-label, .coptic-btn {
        font-size: 18px;
    }

    .coptic-intro, .coptic-arabic-text {
        font-size: 15px;
    }

    .coptic-entry {
        font-size: 18px;
    }

    .keyboard-key {
        font-size: 1.9rem;
        padding: 10px 0;
        min-width: 35px;
    }
}

@media (max-width: 576px) {
    html {
        font-size: 12px;
    }

    .coptic-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .coptic-label {
        font-size: 16px;
    }

    .coptic-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    [dir="ltr"] .coptic-btn {
        margin-right: 10px;
    }

    [dir="rtl"] .coptic-btn {
        margin-left: 10px;
    }

    [dir="ltr"] .play-sound-btn {
        margin-right: 10px;
    }

    [dir="rtl"] .play-sound-btn {
        margin-left: 10px;
    }

    .coptic-intro, .coptic-arabic-text {
        font-size: 14px;
    }

    .coptic-entry {
        font-size: 16px;
    }

    .keyboard-key {
        font-size: 1.7rem;
        padding: 8px 0;
        min-width: 30px;
    }
}

/* Grid for prayer cards */
.coptic-prayer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
    align-items: stretch;
}

/* Responsive: 1 column on tablets & mobiles */
@media (max-width: 768px) {
    .coptic-prayer-grid {
        grid-template-columns: 1fr;
    }
}

/* Prayer card style */
.coptic-prayer-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 14px 16px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

    .coptic-prayer-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
/* Override: keep default .coptic-label text RIGHT-aligned everywhere */
.coptic-label {
    text-align: right !important;
}

/* But inside prayer cards, force center */
.coptic-prayer-card .coptic-label {
    text-align: center !important;
}

/* Responsive text adjustments */
@media (max-width: 992px) {
    .coptic-prayer-card {
        padding: 12px 14px;
    }

        .coptic-prayer-card .coptic-label {
            font-size: 20px;
        }
}

@media (max-width: 576px) {
    .coptic-prayer-card .coptic-label {
        font-size: 16px;
    }
}

/* Footer - Fixed for Somee.com ads */
footer.footer {
    flex-shrink: 0;
    background: #f8f9fa;
    text-align: center;
    width: 100%;
    padding: 1rem 0;
    margin-top: 3rem;
    border-top: 1px solid #dee2e6;
    z-index: 1000;
}

/* New classes for bilingual support */
.arabic-text-class {
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 22px;
}

.coptic-text-class {
    font-family: 'Avva_Shenouda', Arial, sans-serif;
    font-weight: bold;
    font-size: 22px;
}

.arabic-text-header-class {
    font-family: Arial, sans-serif;
    font-size: 22px;
    font-weight: bold;
}

.arabic-label-class {
    flex: 1;
    margin: 0;
}

/* LTR text alignment for arabic-label-class */
[dir="ltr"] .arabic-label-class {
    text-align: left !important;
}

/* RTL text alignment for arabic-label-class */
[dir="rtl"] .arabic-label-class {
    text-align: right !important;
}

.button-container {
    display: flex;
    gap: 20px;
    padding: 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.sound-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    font-size: 24px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

    .sound-btn::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.5);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }

    .sound-btn:hover {
        background: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
        transform: translateY(-4px);
        box-shadow: 0 8px 25px rgba(0, 123, 255, 0.6);
    }

        .sound-btn:hover::before {
            width: 300px;
            height: 300px;
        }

    .sound-btn:active {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
    }

    .sound-btn i {
        position: relative;
        z-index: 1;
    }

    .sound-btn.playing {
        animation: pulse 0.6s ease-out;
    }

@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    }

    50% {
        box-shadow: 0 4px 25px rgba(0, 123, 255, 0.8), 0 0 30px rgba(0, 123, 255, 0.6);
    }

    100% {
        box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.sound-btn.playing i {
    animation: spin 1s linear infinite;
}

button[onclick*="playSound"]:focus,
button[onclick*="playSound"]:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
    border-radius: 6px;
}

.play-sound-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0 8px;
    cursor: pointer;
    flex-shrink: 0;
    align-self: center;
}

    .play-sound-btn i {
        display: flex;
        align-items: center;
        justify-content: center;
    }

/* Sound button margins */
[dir="ltr"] .play-sound-btn {
    margin-right: 15px;
}

[dir="rtl"] .play-sound-btn {
    margin-left: 15px;
}
.container {
    direction: inherit;
}
.table tr {
    white-space: normal !important;
    word-wrap: break-word;
    word-break: break-word;
}