@charset "UTF-8";

/*
 * TravianZ RTL (Right-to-Left) Stylesheet
 * Loaded conditionally when LANG === 'fa'
 */

/* ===== Font Face ===== */
@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/vazirmatn/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ===== Base RTL ===== */
html[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] body {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    text-align: right;
}

/* ===== Navigation ===== */
html[dir="rtl"] div#side_navi {
    float: right;
    text-align: right;
}

html[dir="rtl"] div#side_navi p {
    text-align: right;
}

/* ===== Content Area ===== */
html[dir="rtl"] div#content {
    float: right;
    direction: rtl;
}

html[dir="rtl"] div#side_info {
    float: left;
}

/* ===== Tables ===== */
html[dir="rtl"] table {
    direction: rtl;
}

html[dir="rtl"] table td,
html[dir="rtl"] table th {
    text-align: right;
}

html[dir="rtl"] table td.num,
html[dir="rtl"] table td.unit_num {
    text-align: left;
    direction: ltr;
}

/* ===== Forms ===== */
html[dir="rtl"] form label {
    float: right;
    text-align: right;
}

html[dir="rtl"] form input[type="text"],
html[dir="rtl"] form input[type="password"],
html[dir="rtl"] form input[type="email"],
html[dir="rtl"] form textarea,
html[dir="rtl"] form select {
    direction: rtl;
    text-align: right;
}

/* ===== Resource Bar ===== */
html[dir="rtl"] div#res {
    direction: rtl;
}

html[dir="rtl"] div#res td {
    direction: ltr;
    unicode-bidi: embed;
}

/* ===== Village Overview ===== */
html[dir="rtl"] div#village_map {
    direction: ltr;
}

/* ===== Messages ===== */
html[dir="rtl"] div.messages {
    direction: rtl;
    text-align: right;
}

/* ===== Reports ===== */
html[dir="rtl"] div.reports {
    direction: rtl;
    text-align: right;
}

/* ===== Alliance ===== */
html[dir="rtl"] div.alliance {
    direction: rtl;
    text-align: right;
}

/* ===== Numbers and Coordinates ===== */
html[dir="rtl"] .coordinates,
html[dir="rtl"] .res_value,
html[dir="rtl"] .timer,
html[dir="rtl"] span.timer {
    direction: ltr;
    unicode-bidi: embed;
    display: inline-block;
}

/* ===== Build Queue ===== */
html[dir="rtl"] div.build_details {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] div.build_details .costs {
    direction: ltr;
    unicode-bidi: embed;
}

/* ===== Troop Movements ===== */
html[dir="rtl"] table.troop_details {
    direction: rtl;
}

html[dir="rtl"] table.troop_details td.unit_num {
    direction: ltr;
    text-align: center;
}

/* ===== Language Switcher ===== */
.lang-switcher {
    display: inline-block;
    font-size: 11px;
    padding: 2px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #f9f9f9;
    cursor: pointer;
    text-decoration: none;
    color: #555;
}

.lang-switcher:hover {
    background: #e9e9e9;
    border-color: #999;
}

.lang-switcher.active {
    font-weight: bold;
    border-color: #71d000;
    color: #333;
}

/* ===== Village Name Fix ===== */
html[dir="rtl"] h1 {
    text-align: right;
    direction: rtl;
}

html[dir="rtl"] div#loyality {
    float: left;
    margin-left: 10px;
    margin-right: 0;
}

html[dir="rtl"] #side_info .village_list,
html[dir="rtl"] #side_info a {
    text-align: right;
    direction: rtl;
}
