@font-face {
    font-family: "Noto Sans Arabic Local";
    src: url("../fonts/NotoSansArabic-Variable.ttf") format("truetype");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f6f7;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.navbar {
    background: #151718;
    border-bottom: 1px solid #2b2e30;
    padding: .75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    color: #fff;
    text-decoration: none;
}

.brand-banner {
    display: inline-flex;
    flex-direction: column;
    direction: ltr;
    text-align: left;
    min-width: 145px;
    padding: .42rem .85rem;
    border: 1px solid #484c4f;
    border-radius: 5px;
    background: #1d2022;
    line-height: 1.05;
    letter-spacing: .04em;
}

.brand-name { font-size: 1.05rem; font-weight: 800; }
.brand-tagline { margin-top: .25rem; color: #bdbdbd; font-size: .67rem; font-weight: 500; text-transform: uppercase; }
.brand-banner:hover { border-color: #687077; background: #24282b; }

.nav-menu {
    display: flex;
}

.navbar-toggler {
    display: none;
    width: 42px;
    height: 38px;
    padding: 0;
    border: 1px solid #484c4f;
    border-radius: 6px;
    background: #1d2022;
    cursor: pointer;
}

.navbar-toggler span,
.navbar-toggler span::before,
.navbar-toggler span::after {
    display: block;
    width: 20px;
    height: 2px;
    margin: auto;
    background: #e6e8e9;
    content: "";
}

.navbar-toggler span { position: relative; }
.navbar-toggler span::before { position: absolute; top: -6px; left: 0; }
.navbar-toggler span::after { position: absolute; top: 6px; left: 0; }

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: #e5e5e5;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #fff;
}

.btn-nav {
    background: #526d82;
    color: #fff !important;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
}

.btn-nav:hover {
    background: #40596b;
}

.hero {
    background: #1d2022;
    color: #fff;
    padding: 5rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.75rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-primary {
    background: #fff;
    color: #526d82;
}

.btn-primary:hover {
    background: #f0f0f0;
}

.btn-secondary {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: #526d82;
    color: #fff;
}

.btn-small:hover {
    background: #40596b;
}

.btn-block {
    width: 100%;
}

.features {
    padding: 4rem 0;
}

.features h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: center;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: #666;
    font-size: 0.95rem;
}

.page-header {
    background: #f1f5f9;
    padding: 3rem 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #666;
}

.products-grid, .services-grid, .downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 3rem 0;
}

.product-card, .service-card, .download-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    padding: 1.5rem;
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-info {
    padding-top: 1rem;
}

.product-category {
    display: inline-block;
    background: #e8f0fe;
    color: #526d82;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-version {
    display: block;
    color: #888;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.service-card h3 {
    color: #526d82;
    margin-bottom: 0.75rem;
}

.service-card p {
    color: #666;
}

.download-card {
    text-align: center;
}

.download-card h3 {
    margin-bottom: 0.5rem;
}

.download-card p {
    color: #888;
    margin-bottom: 1rem;
}

.contact-section {
    padding: 3rem 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info h3 {
    color: #526d82;
    margin: 1.5rem 0 0.5rem;
}

.contact-form h3 {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: #526d82;
    box-shadow: 0 0 0 2px rgba(82,109,130,.16);
}

.auth-section {
    display: flex;
    justify-content: center;
    padding: 4rem 0;
}

.auth-card {
    background: #fff;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 1rem;
}

.footer {
    background: #1a1a2e;
    color: #ccc;
    padding: 3rem 0 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer h3, .footer h4 {
    color: #fff;
    margin-bottom: 1rem;
}

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer a {
    color: #aaa;
    text-decoration: none;
}

.footer a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.product-detail {
    padding: 3rem 0 5rem;
}

.product-back {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: #526d82;
    text-decoration: none;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
    gap: 3rem;
    align-items: start;
}

.product-main-image, .product-image-placeholder {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    background: #eef2f7;
    object-fit: contain;
}

.product-image-placeholder {
    display: grid;
    place-items: center;
    color: #68717a;
}

.product-screenshot-list {
    display: flex;
    overflow-x: auto;
    gap: .75rem;
    margin-top: 1rem;
    padding-bottom: .5rem;
}

.product-thumbnail {
    flex: 0 0 120px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    background: transparent;
    overflow: hidden;
    cursor: pointer;
}

.admin-cover-preview {
    max-width: 560px;
    margin: 1rem 0;
}

.admin-cover-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 10px;
    object-fit: contain;
    background: #eef2f7;
}

.cover-delete-form { margin: .75rem 0 1rem; }

.product-thumbnail:hover, .product-thumbnail:focus {
    border-color: #526d82;
}

.product-thumbnail img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.product-detail-content h1 {
    margin: .5rem 0 1rem;
    font-size: 2.25rem;
}

.product-description {
    margin: 1.5rem 0;
    color: #46505a;
    line-height: 1.75;
    white-space: pre-line;
}

.download-request-box {
    margin-top: 2rem;
    padding: 1.25rem;
    border: 1px solid #dce2e8;
    border-radius: 10px;
    background: #f8fafc;
}

.download-request-box h2 {
    margin-bottom: .5rem;
    font-size: 1.2rem;
}

.download-request-box p {
    margin-bottom: 1rem;
    color: #68717a;
    font-size: .92rem;
}

.download-ready-link {
    display: inline-block;
    margin: 0 0 1rem;
}

.field-validation {
    color: #b42318;
    font-size: .88rem;
}

.product-images-admin {
    margin-top: 2rem;
    padding: 2rem;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.media-upload-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin: 1.5rem 0;
    padding: 1.25rem;
    border: 1px solid #dce2e8;
    border-radius: 8px;
    background: #f8f9fa;
}

.admin-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.admin-media-card {
    position: relative;
    padding: .75rem;
    border: 1px solid #dce2e8;
    border-radius: 10px;
}

.admin-media-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    margin-bottom: .75rem;
    border-radius: 6px;
    object-fit: cover;
}

.media-cover-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: .25rem .6rem;
    border-radius: 999px;
    color: #fff;
    background: #16803c;
    font-size: .8rem;
    font-weight: 700;
}

.logout-form { margin: 0; }
.logout-button { border: 0; font: inherit; cursor: pointer; }
.nav-user-name { color: #c4c4c4; font-size: .9rem; }

.language-menu-item { position: relative; }
.language-dropdown { position: relative; }
.language-dropdown summary {
    display: flex;
    align-items: center;
    gap: .45rem;
    min-width: 112px;
    padding: .45rem .7rem;
    border: 1px solid #4a4a4a;
    border-radius: 6px;
    color: #f2f2f2;
    background: #191919;
    cursor: pointer;
    list-style: none;
    font-size: .9rem;
}
.language-dropdown summary::-webkit-details-marker { display: none; }
.language-dropdown summary::after { content: "▾"; margin-inline-start: auto; color: #aaa; }
.language-dropdown[open] summary { border-color: #777; background: #222; }
.language-dropdown-menu {
    position: absolute;
    top: calc(100% + .45rem);
    right: 0;
    z-index: 120;
    min-width: 150px;
    padding: .35rem;
    border: 1px solid #3b3b3b;
    border-radius: 7px;
    background: #111;
    box-shadow: 0 12px 28px rgba(0,0,0,.35);
}
.language-dropdown-menu a { display: block; padding: .55rem .7rem; border-radius: 5px; color: #ddd; white-space: nowrap; }
.language-dropdown-menu a:hover { background: #292929; color: #fff; }
.language-dropdown-menu a.active { background: #353535; color: #fff; font-weight: 700; }

.language-dropdown-menu button {
    display: block;
    width: 100%;
    padding: .55rem .7rem;
    border: 0;
    border-radius: 5px;
    color: #ddd;
    background: transparent;
    text-align: start;
    white-space: nowrap;
    cursor: pointer;
    font: inherit;
}
.language-dropdown-menu button:hover { background: #292929; color: #fff; }

.portal-shell { display: flex; flex-direction: column; min-height: 100vh; }
.portal-main { flex: 1; padding: 2.5rem 0; background: #f5f6f7; }
.portal-footer { padding: 1.25rem 0; text-align: center; }
.portal-footer p { margin: 0; }
.portal-nav-links { gap: 1rem; }
.portal-nav-links .active { color: #fff; font-weight: 700; }
.portal-navbar .logout-button { color: #fff; }
.admin-main .page-header { margin: -2.5rem 0 2rem; }

html[dir="rtl"] .language-dropdown-menu { right: auto; left: 0; }

@media (max-width: 1100px) {
    .portal-navbar .container { flex-wrap: wrap; }
    .portal-navbar .navbar-toggler { display: block; }
    .portal-navbar .nav-menu { display: none; flex-basis: 100%; padding-top: .75rem; }
    .portal-navbar .nav-menu.active { display: block; }
    .portal-navbar .nav-links { flex-direction: column !important; align-items: stretch; gap: .35rem; }
    .portal-navbar .nav-links a { display: block; padding: .55rem .65rem; }
    .portal-navbar .language-dropdown summary { width: 100%; }
    .portal-navbar .language-dropdown-menu { position: static; margin-top: .35rem; width: 100%; }
}

html[dir="rtl"] body {
    font-family: "Noto Sans Arabic Local", Tahoma, "Segoe UI", Arial, sans-serif;
    line-height: 1.8;
    letter-spacing: 0;
}
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] .navbar-brand,
html[dir="rtl"] .btn {
    font-family: "Noto Sans Arabic Local", Tahoma, "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}
html[dir="rtl"] h1,
html[dir="rtl"] h2 { font-weight: 750; }
html[dir="rtl"] p,
html[dir="rtl"] .product-description { font-size: 1.04rem; }
html[dir="rtl"] .nav-links,
html[dir="rtl"] .hero-actions,
html[dir="rtl"] .media-upload-form { flex-direction: row; }
html[dir="rtl"] .product-detail-content,
html[dir="rtl"] .product-description,
html[dir="rtl"] .form-group,
html[dir="rtl"] .feature-card,
html[dir="rtl"] .product-card-content,
html[dir="rtl"] .contact-content,
html[dir="rtl"] .footer { text-align: right; }
html[dir="rtl"] input,
html[dir="rtl"] textarea { text-align: right; }
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"] { direction: ltr; text-align: left; }
html[dir="rtl"] .mud-typography,
html[dir="rtl"] .mud-button-root,
html[dir="rtl"] .mud-input,
html[dir="rtl"] .mud-table-cell,
html[dir="rtl"] .mud-nav-link,
html[dir="rtl"] .mud-menu-item { font-family: "Noto Sans Arabic Local", Tahoma, Arial, sans-serif; }
html[dir="rtl"] .product-screenshot-list { direction: rtl; }
html[dir="rtl"] .media-cover-badge { left: auto; right: 1rem; }

@media (max-width: 1024px) {
    .contact-grid,
    .product-detail-grid { grid-template-columns: 1fr; }
    .contact-grid { gap: 2rem; }
    .product-detail-content h1 { font-size: 1.9rem; }
}

@media (max-width: 800px) {
    .navbar .container { flex-wrap: wrap; }
    .navbar-toggler { display: block; }
    .nav-menu { display: none; flex-basis: 100%; padding-top: .75rem; }
    .nav-menu.active { display: block; }
    .nav-links { flex-direction: column !important; align-items: stretch; gap: .35rem; }
    .nav-links a { display: block; padding: .55rem .65rem; }
    .language-dropdown summary { width: 100%; }
    .language-dropdown-menu { position: static; margin-top: .35rem; width: 100%; }
    .products-grid,
    .services-grid,
    .downloads-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
    .footer-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

@media (max-width: 600px) {
    .container { padding-inline: 1rem; }
    .brand-banner { min-width: 132px; }
    .hero { padding: 3.5rem 0; }
    .hero h1 { font-size: clamp(1.85rem, 9vw, 2.35rem); line-height: 1.3; }
    .hero p { font-size: 1rem; }
    .hero-actions { flex-direction: column !important; align-items: stretch; }
    .hero-actions .btn { width: 100%; }
    .features,
    .contact-section { padding: 2.5rem 0; }
    .features h2 { margin-bottom: 2rem; font-size: 1.7rem; }
    .features-grid,
    .products-grid,
    .services-grid,
    .downloads-grid,
    .footer-grid,
    .admin-media-grid { grid-template-columns: minmax(0, 1fr); }
    .feature-card,
    .product-card,
    .service-card,
    .download-card,
    .auth-card { padding: 1.25rem; }
    .page-header { padding: 2.25rem 0; }
    .page-header h1 { font-size: 1.7rem; }
    .contact-grid { gap: 1.5rem; }
    .product-detail-content h1 { font-size: 1.65rem; }
    .product-screenshot { width: min(82vw, 320px); }
    .footer { padding-top: 2.25rem; }
}
