:root {
    --azd-primary: #1b4fd6;
    --azd-red: #d7263d;
    --azd-amber: #f2a900;
    --azd-dark: #0f1b33;
    --bs-primary: var(--azd-primary);
    --bs-primary-rgb: 27, 79, 214;
    --bs-link-color: var(--azd-primary);
    --bs-link-color-rgb: 27, 79, 214;
}

html { font-size: 15px; }
@media (min-width: 768px) { html { font-size: 16px; } }

body {
    font-family: "Noto Sans Armenian", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    background: #f5f7fb;
}

.btn-primary { --bs-btn-bg: var(--azd-primary); --bs-btn-border-color: var(--azd-primary); --bs-btn-hover-bg: #153fb0; --bs-btn-hover-border-color: #153fb0; }
.btn-outline-primary { --bs-btn-color: var(--azd-primary); --bs-btn-border-color: var(--azd-primary); --bs-btn-hover-bg: var(--azd-primary); --bs-btn-hover-border-color: var(--azd-primary); }

/* ---------- Header ---------- */
.brand-name { font-weight: 700; font-size: 1.25rem; color: var(--azd-dark); }
.brand-tagline { font-size: .7rem; }

.critical-banner { background: var(--azd-red); color: #fff; animation: pulse-bg 2.5s ease-in-out infinite; }
@keyframes pulse-bg { 50% { background: #b01d31; } }

/* ---------- Home ---------- */
.hero { background: linear-gradient(135deg, #0f1b33 0%, #1b4fd6 70%, #3a6cf0 100%); color: #fff; }
.section-tile {
    display: flex; flex-direction: column; gap: .3rem; height: 100%;
    padding: 1.1rem 1.2rem; border-radius: 1rem; color: #fff; text-decoration: none;
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); transition: .2s;
}
.section-tile:hover { background: rgba(255, 255, 255, .2); color: #fff; transform: translateY(-2px); }
.section-tile i { font-size: 1.8rem; }
.section-tile span { font-size: .85rem; opacity: .85; }

/* ---------- Cards ---------- */
.item-card { transition: box-shadow .2s, transform .2s; border: 0; box-shadow: 0 1px 3px rgba(15, 27, 51, .08); }
.item-card:hover { box-shadow: 0 8px 24px rgba(15, 27, 51, .12); transform: translateY(-2px); }
.thumb { height: 150px; object-fit: cover; }
.detail-img { max-height: 420px; object-fit: cover; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pre-line { white-space: pre-line; }
.card { border-color: #e4e8f0; }

.ann-type { background: #e9eefc; color: var(--azd-primary); }
.ann-sale, .ann-purchase, .ann-rent { background: #e6f6ec; color: #197a3c; }
.ann-job, .ann-jobseeking { background: #fff4d6; color: #8a6100; }
.ann-lost, .ann-found, .ann-search { background: #fde8eb; color: #a61c2f; }
.ann-question { background: #efe8fd; color: #5b2bb5; }

/* ---------- Notice levels ---------- */
/* Բաժնի ենթաբաժինների ներդիրներ (Հայտարարություններ → Աճուրդներ …)․ հեռախոսում՝ հորիզոնական թերթվող */
.section-tabs { border-bottom: 1px solid var(--bs-border-color); }
.section-tabs .nav { overflow-x: auto; scrollbar-width: none; }
.section-tabs .nav::-webkit-scrollbar { display: none; }
.section-tabs .nav-link { white-space: nowrap; padding-bottom: .55rem; }

/* Լրահոս՝ ռիլեր (ուղղահայաց 9:16) և ժամանց */
.min-w-0 { min-width: 0; }
.reel-frame { position: relative; aspect-ratio: 9 / 16; max-height: 640px; background: #000; border-radius: var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius) 0 0; overflow: hidden; }
.reel-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.event-thumb { background: #f1f3f5; min-height: 7.5rem; overflow: hidden; border-radius: var(--bs-card-inner-border-radius) 0 0 var(--bs-card-inner-border-radius); }
.event-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-thumb-empty { height: 100%; min-height: 7.5rem; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #adb5bd; }

/* Աճուրդներ */
.auction-card { overflow: hidden; }
.auction-thumb { background: #f1f3f5; min-height: 7rem; }
.auction-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auction-thumb-empty { height: 100%; min-height: 7rem; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #adb5bd; }
.auction-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.auction-price { color: var(--azd-primary); }
.auction-hero { max-height: 420px; object-fit: cover; }

.notice-card { border-left: 5px solid #adb5bd; }
.notice-card .level-badge { background: #e9ecef; color: #495057; }
.notice-card.level-important { border-left-color: var(--azd-amber); }
.notice-card.level-important .level-badge { background: #fff4d6; color: #8a6100; }
.notice-card.level-critical { border-left-color: var(--azd-red); background: #fff7f8; }
.notice-card.level-critical .level-badge { background: var(--azd-red); color: #fff; }

.level-option { border: 2px solid #dee2e6; background: #fff; }
.btn-check:checked + .level-option.level-normal { border-color: #6c757d; background: #f1f3f5; }
.btn-check:checked + .level-option.level-important { border-color: var(--azd-amber); background: #fff8e1; }
.btn-check:checked + .level-option.level-critical { border-color: var(--azd-red); background: #fdecee; }

/* ---------- Rating ---------- */
.stars, .star-btn { color: var(--azd-amber); }
.star-btn { font-size: 1.2rem; line-height: 1; }
.rate-form:hover .star-btn i::before { content: "\F588"; } /* bi-star-fill */
.rate-form .star-btn:hover ~ .star-btn i::before { content: "\F586"; } /* bi-star */

/* ---------- Location picker ---------- */
.lp-chip { font-size: .85rem; font-weight: 500; padding: .45rem .6rem; }
.btn-close-sm { width: .5em; height: .5em; }

/* ---------- Admin ---------- */
.admin-nav .list-group-item.active { background: var(--azd-primary); border-color: var(--azd-primary); }
.sticky-save { position: sticky; bottom: 0; background: #f5f7fb; border-top: 1px solid #e4e8f0; }
.translations td { vertical-align: top; }

/* ---------- Footer ---------- */
.site-footer { background: var(--azd-dark); color: #cfd8ea; }
.site-footer a { color: #fff; text-decoration: none; opacity: .85; }
.site-footer a:hover { opacity: 1; text-decoration: underline; }
.site-footer h6 { color: #fff; letter-spacing: .05em; font-size: .8rem; margin-bottom: 1rem; }
.site-footer li { margin-bottom: .4rem; }
.site-footer .footer-sub { margin: .4rem 0 0 .9rem; }
.footer-bottom { background: rgba(0, 0, 0, .25); }


.validation-summary-valid { display: none; }


/* Թարգմանության վահանակ (ցուցադրվում է միայն օտար լեզվով նյութերի առկայության դեպքում) */
.translate-bar { display: none; }
.translate-bar.show { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .875rem;
    background: #f8f9fb; border: 1px solid #e4e8f0; border-radius: .5rem; padding: .4rem .75rem; }

/* Հուսալիության բլոկ */
.trust-box { background: #eefaf3; border: 1px solid #cdebd9; border-radius: .75rem; padding: .75rem 1rem; }

/* ---------- Header v2․ լոգո + որոնում + օգտվող, ապա մենյուն առանձին տողով ---------- */
/* position+z-index՝ որպեսզի լեզվի և օգտվողի ցանկերը բացվեն sticky մենյուի (z-index 1020) վրայից, ոչ թե տակից */
.brandbar { background: #fff; position: relative; z-index: 1030; }
.brandbar .navbar-brand { flex-shrink: 0; }
/* Որոնումը՝ լոգոյի և օգտվողի միջև, փոքր էկրաններին՝ առանձին տողով ամբողջ լայնքով */
.header-search { order: 3; flex: 1 1 100%; min-width: 0; }
.header-user { order: 2; }
@media (min-width: 768px) {
    /* flex-basis 0՝ որոնումը զբաղեցնում է միայն մնացած տեղը, և լեզվի/օգտվողի կոճակները չեն իջնում նոր տող */
    .header-search { order: 2; flex: 1 1 0; max-width: 42rem; }
    .header-user { order: 3; }
}
.header-search .input-group-text { border-right: 0; color: #6c757d; }
.header-search .form-control { border-left: 0; min-width: 0; }
.header-search .form-control:focus { box-shadow: none; border-color: #dee2e6; }
.header-search .input-group:focus-within { box-shadow: 0 0 0 .2rem rgba(27, 79, 214, .2); border-radius: .375rem; }
.header-search .btn { white-space: nowrap; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem;
    border-radius: 50%; color: #334; font-size: 1.25rem; text-decoration: none; }
.icon-btn:hover { background: #eef2fa; color: var(--azd-primary); }
.icon-btn.lang-btn { width: auto; min-width: 2.4rem; padding: 0 .55rem; border-radius: 1.2rem; }
.icon-btn .badge { position: absolute; top: .1rem; right: .05rem; font-size: .62rem; }

.user-btn { color: #223; border-radius: 2rem; padding: .15rem .5rem .15rem .15rem; }
.user-btn:hover { background: #eef2fa; }
.user-btn.dropdown-toggle::after { display: none; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; flex-shrink: 0;
    border-radius: 50%; background: var(--azd-primary); color: #fff; font-weight: 600; font-size: .9rem; letter-spacing: .02em; }
.user-name { max-width: 11rem; font-weight: 500; }
.user-card { max-width: 18rem; }
.dropdown-menu { max-width: calc(100vw - 1rem); }
.dropdown-item { white-space: normal; }

/* Մենյուն՝ կպչուն, չի փաթաթվում․ նեղ էկրանին թերթվում է հորիզոնական (երկար ռուսերեն/անգլերեն անուններ) */
.mainnav { background: #fff; position: sticky; top: 0; z-index: 1020; }
.main-menu { overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; }
.main-menu::-webkit-scrollbar { display: none; }
/* Մեջտեղում, հավասար լայնքով բաժիններ */
.main-menu { width: 100%; max-width: 42rem; }
.main-menu .nav-item { flex: 1 1 0; min-width: 0; }
.main-menu .nav-link { white-space: nowrap; font-weight: 500; color: #334; padding: .7rem .9rem; border-bottom: 3px solid transparent;
    display: flex; justify-content: center; align-items: center; gap: .4rem; }
.main-menu .nav-link:hover { color: var(--azd-primary); }
.main-menu .nav-link.active { color: var(--azd-primary); border-bottom-color: var(--azd-primary); }
/* Հեռախոսում՝ «tab bar»․ երեք հավասար սյունակ, պատկերակը՝ վերևում, տեքստը՝ փոքր (հայերեն «Հայտարարություններ»-ը տեղավորվում է) */
@media (max-width: 575.98px) {
    .main-menu { overflow: visible; }
    .main-menu .nav-item { flex: 1 1 auto; min-width: 0; }
    .main-menu .nav-link { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .35rem .15rem .3rem;
        font-size: .72rem; line-height: 1.2; }
    .main-menu .nav-link span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
    .main-menu .nav-link i { font-size: 1.15rem; }
}

/* ---------- Բազմալեզու բովանդակություն ---------- */
/* Երկար բառեր (հայերեն/ռուսերեն բարդ բառեր, URL-ներ) չպետք է դուրս գան քարտերից */
.card-title, .card-text, h1, h2, h3, .notice-card, .item-card, .alert { overflow-wrap: anywhere; }
.btn { max-width: 100%; }
.d-flex.gap-2 > form { max-width: 100%; }
.form-label { overflow-wrap: anywhere; }
.org-list { max-height: 12rem; overflow-y: auto; }
