/* Base font size */
html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html {
    position: relative;
    min-height: 100%;
}

/* Body */
body {
    margin-bottom: 60px;
    direction: rtl;
}

/* Fonts */
@font-face {
    font-family: 'Avva_Shenouda';
    src: url('/fonts/Avva_Shenouda.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-label {
    font-size: 20px;
    font-family: 'Avva_Shenouda', sans-serif;
    font-weight: bold;
    color: white;
    text-align: center;
}

/* Cards grid with RTL support */
.coptic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

/* Card styling */
.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;
}

    .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;
}

.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;
    margin-left: 15px;
    flex-shrink: 0;
}

/* 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;
}

.table td:last-child {
    width: auto;
    padding-left: 5px;
}

/* 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;
}

.coptic-arabic-text {
    font-size: 20px;
    margin-bottom: 8px;
}

.intro-coptic-label {
    font-size: 22px;
    margin: 5px 0 15px 0;
}

/* 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;
}

/* 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: 1rem;
    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: 0.95rem;
        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;
        margin-left: 10px;
    }

    .coptic-intro, .coptic-arabic-text {
        font-size: 14px;
    }

    .coptic-entry {
        font-size: 16px;
    }

    .keyboard-key {
        font-size: 0.85rem;
        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; /* make all cards in a row equal height */
}

/* 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; /* center vertically */
    align-items: center; /* center horizontally */
    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.footer {
    position: absolute;
    background: #f8f9fa;
    text-align: center;
    width: 100%;
    line-height: 60px;
    white-space: nowrap;
    bottom: 75px;
}