/* ============================================================
   ACE Root Browser CSS
   File: css/ace_root_browser.css
   ============================================================ */

:root {
    --ace-bg: #f7f9fc;
    --ace-panel: #ffffff;
    --ace-border: #d8dee9;
    --ace-border-dark: #b8c1cc;
    --ace-header: #eef3f8;
    --ace-text: #1f2933;
    --ace-muted: #667085;
    --ace-link: #0077cc;
    --ace-link-hover: #005fa3;
    --ace-button-bg: #0b74c9;
    --ace-button-hover: #095fa5;
    --ace-button-text: #ffffff;
}

body {
    font-family: Arial, sans-serif;
    margin: 20px;
    line-height: 1.35;
    color: var(--ace-text);
    background: var(--ace-bg);
}

h2 {
    margin-top: 0;
    margin-bottom: 12px;
}

p {
    margin: 10px 0;
}

/* ------------------------------
   Control panel
------------------------------ */

.controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 18px;
    padding: 12px;
    background: var(--ace-panel);
    border: 1px solid var(--ace-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.controls label {
    margin-right: 4px;
}

.controls select,
.controls input[type="number"] {
    padding: 5px 7px;
    border: 1px solid var(--ace-border-dark);
    border-radius: 5px;
    background: #ffffff;
    font-size: 14px;
}

.controls input[type="number"] {
    width: 64px;
}

.controls button {
    padding: 6px 12px;
    border: 1px solid var(--ace-button-bg);
    border-radius: 5px;
    background: var(--ace-button-bg);
    color: var(--ace-button-text);
    font-weight: bold;
    cursor: pointer;
}

.controls button:hover {
    background: var(--ace-button-hover);
    border-color: var(--ace-button-hover);
}

/* ------------------------------
   Dictionary table
------------------------------ */

table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 12px;
    background: var(--ace-panel);
    border: 1px solid var(--ace-border);
}

th,
td {
    border: 1px solid var(--ace-border-dark);
    padding: 7px 9px;
    vertical-align: top;
}

th {
    background: var(--ace-header);
    text-align: left;
}

td:first-child {
    width: 220px;
    font-weight: bold;
    color: #344054;
    background: #fafafa;
}

/* ------------------------------
   Arabic / Urdu display
------------------------------ */

.ar {
    font-size: 150%;
    direction: rtl;
    unicode-bidi: isolate;
    font-family: Amiri, "Traditional Arabic", "Times New Roman", serif;
    line-height: 1.8;
}

.ur {
    direction: rtl;
    unicode-bidi: isolate;
    font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif;
    font-size: 120%;
}

/* ------------------------------
   Links and notes
------------------------------ */

.small {
    color: var(--ace-muted);
    font-size: 90%;
}

a.button-link {
    display: inline-block;
    padding: 5px 9px;
    text-decoration: none;
    color: var(--ace-link);
    font-weight: bold;
    border-radius: 5px;
}

a.button-link:hover {
    color: var(--ace-link-hover);
    background: #eef6ff;
}

/* ------------------------------
   Mobile layout
------------------------------ */

@media (max-width: 700px) {
    body {
        margin: 12px;
    }

    .controls {
        display: block;
    }

    .controls label,
    .controls select,
    .controls input,
    .controls button {
        display: block;
        margin: 6px 0;
        max-width: 100%;
    }

    table,
    tbody,
    tr,
    th,
    td {
        display: block;
        width: 100%;
    }

    th {
        display: none;
    }

    td:first-child {
        width: auto;
        border-bottom: 0;
    }
}
