/* ============================================
   ALMH.SD – MAIN STYLES
   Modern Minimal RTL Design System
   Palette: #F7F6F2 (bg), #202124 (text),
            #315C52 (accent), #E8E4DA (borders)
   ============================================ */

/* ---------- Reset & Base ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: #F7F6F2;
    color: #202124;
    line-height: 1.7;
    direction: rtl;
}

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

a {
    text-decoration: none;
    color: #315C52;
    transition: color 0.2s;
}
a:hover {
    color: #3A6E62;
}

img {
    max-width: 100%;
    height: auto;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: #202124;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 40px;
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
}
.btn:active {
    transform: translateY(0);
}
.btn:focus-visible {
    outline: 2px solid #315C52;
    outline-offset: 2px;
}

.btn-primary {
    background: #315C52;
    color: #F7F6F2;
    border-color: #315C52;
}
.btn-primary:hover {
    background: #3A6E62;
    border-color: #3A6E62;
    box-shadow: 0 3px 8px rgba(49, 92, 82, 0.15);
}

.btn-secondary {
    background: transparent;
    color: #202124;
    border-color: #D8D5CC;
}
.btn-secondary:hover {
    background: #E8E4DA;
    border-color: #C0BDB4;
}

.btn-sm {
    padding: 0.2rem 0.8rem;
    font-size: 0.75rem;
    border-radius: 4px;
    min-height: 30px;
}
.btn-sm.approve {
    background: #315C52;
    color: #F7F6F2;
    border-color: #315C52;
}
.btn-sm.reject {
    background: #A0A2A6;
    color: #F7F6F2;
    border-color: #A0A2A6;
}

/* ---------- Header ---------- */
.site-header {
    background: #FBF9F6;
    border-bottom: 1px solid #E8E4DA;
    padding: 0.6rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.logo img {
    height: 40px;
    width: auto;
    display: block;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: #5F6368;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.2rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}

.main-nav a:hover {
    color: #315C52;
    border-bottom-color: #315C52;
}

/* ---------- Footer ---------- */
.site-footer {
    background: #202124;
    color: #A0A2A6;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

.site-footer a {
    color: #D8D5CC;
}
.site-footer a:hover {
    color: #F7F6F2;
}

/* ---------- Cards ---------- */
.card {
    background: #FBF9F6;
    border: 1px solid #E8E4DA;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.04);
    border-color: #D8D5CC;
}

.card-body {
    padding: 1rem 1.2rem 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ---------- Grids ---------- */
.products-grid,
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
}

@media (max-width: 900px) {
    .products-grid,
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .products-grid,
    .articles-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Product Card ---------- */
.product-image {
    height: 160px;
    background: #E8E4DA;
    overflow: hidden;
    flex-shrink: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.02);
}

.placeholder-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #A0A2A6;
    font-size: 0.8rem;
}

.product-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.product-card .platform {
    color: #5F6368;
    font-size: 0.75rem;
    margin-bottom: 0.3rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 0.8rem;
}

.product-actions .btn {
    flex: 1;
}

/* ---------- Badges ---------- */
.free-badge,
.price-badge,
.category-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.free-badge {
    background: #E8F0EC;
    color: #315C52;
}

.price-badge {
    background: #D8D5CC;
    color: #202124;
}

.category-badge {
    background: #E8E4DA;
    color: #5F6368;
}

/* ---------- Article Card ---------- */
.article-card .meta {
    color: #A0A2A6;
    font-size: 0.75rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.article-card .excerpt {
    color: #5F6368;
    font-size: 0.88rem;
    line-height: 1.7;
    flex: 1;
    margin-bottom: 0.6rem;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    color: #315C52;
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 2px solid #D8D5CC;
    transition: border-color 0.2s;
    text-decoration: none;
}

.read-more:hover {
    border-color: #315C52;
    color: #3A6E62;
}

/* ---------- Hero (home page) ---------- */
.hero {
    padding: 3rem 0 2rem;
    text-align: center;
    background: linear-gradient(180deg, #FBF9F6 0%, #F7F6F2 100%);
    border-bottom: 1px solid #E8E4DA;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 2.6rem);
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.hero .highlight {
    color: #315C52;
}

.hero-sub {
    font-size: 1rem;
    color: #5F6368;
    line-height: 1.8;
    max-width: 550px;
    margin: 0 auto 1.5rem;
}

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

/* ---------- Stats ---------- */
.stats-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1.5rem 0 2.5rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 0.8rem 1.2rem;
    background: #FBF9F6;
    border: 1px solid #E8E4DA;
    border-radius: 8px;
    min-width: 100px;
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #315C52;
}

.stat-label {
    color: #5F6368;
    font-size: 0.8rem;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    color: #202124;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #D8D5CC;
    border-radius: 6px;
    background: #F7F6F2;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #315C52;
    box-shadow: 0 0 0 3px rgba(49, 92, 82, 0.08);
}

.form-group small {
    color: #A0A2A6;
    font-size: 0.8rem;
    display: block;
    margin-top: 0.2rem;
}

/* ---------- Alerts ---------- */
.error-box,
.success-box,
.info-box {
    padding: 0.7rem 1rem;
    border-radius: 6px;
    margin: 1rem 0;
}

.error-box {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.success-box {
    background: #E8F0EC;
    border: 1px solid #B8C4B0;
    color: #315C52;
}

.info-box {
    background: #E8E4DA;
    border: 1px solid #D8D5CC;
    color: #202124;
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border: 1px solid #E8E4DA;
    border-radius: 4px;
    color: #202124;
    background: #FBF9F6;
    font-size: 0.85rem;
    text-decoration: none;
}

.pagination .active {
    background: #315C52;
    color: #F7F6F2;
    border-color: #315C52;
}

.pagination a:hover {
    background: #E8E4DA;
}

/* ---------- Back to Top ---------- */
#backToTop {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    background: #315C52;
    color: #F7F6F2;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
    box-shadow: 0 3px 10px rgba(49, 92, 82, 0.2);
    transition: background 0.2s, transform 0.2s;
    z-index: 99;
}
#backToTop:hover {
    background: #3A6E62;
    transform: scale(1.05);
}

/* ---------- Search ---------- */
.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 600px;
    margin-bottom: 1.5rem;
}

.search-form input {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 1px solid #D8D5CC;
    border-radius: 6px;
    background: #F7F6F2;
    font-size: 0.95rem;
}

.search-results {
    list-style: none;
    padding: 0;
}

.search-result-item {
    background: #FBF9F6;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #E8E4DA;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        gap: 0.3rem;
    }
    .main-nav ul {
        justify-content: center;
        gap: 0.8rem;
    }
    .main-nav a {
        font-size: 0.8rem;
    }
    .hero {
        padding: 2rem 0 1.5rem;
    }
    .hero h1 {
        font-size: 1.6rem;
    }
    .stats-row {
        gap: 0.8rem;
    }
    .stat-item {
        padding: 0.6rem 0.8rem;
        min-width: 70px;
    }
    .stat-number {
        font-size: 1.4rem;
    }
    .license-wizard {
        padding: 1.2rem;
    }
    .wizard-progress {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .wizard-progress::before {
        display: none;
    }
    .progress-step {
        flex: 0 0 auto;
        flex-direction: row;
        gap: 0.5rem;
    }
    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
        margin-bottom: 0;
    }
    .payment-methods {
        grid-template-columns: 1fr;
    }
    .about-card {
        padding: 1.5rem;
    }
    .tracking-result-card {
        padding: 1.2rem;
    }
    #backToTop {
        width: 38px;
        height: 38px;
        font-size: 1rem;
        bottom: 1rem;
        left: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.6rem;
    }
    .hero h1 {
        font-size: 1.3rem;
    }
    .hero-sub {
        font-size: 0.9rem;
    }
    .products-grid,
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .product-image {
        height: 140px;
    }
    .stats-row {
        gap: 0.4rem;
    }
    .stat-item {
        padding: 0.4rem 0.6rem;
        min-width: 50px;
    }
    .stat-number {
        font-size: 1.2rem;
    }
    .stat-label {
        font-size: 0.7rem;
    }
    .comment-header {
        flex-direction: column;
        gap: 0.2rem;
    }
    .search-form {
        flex-direction: column;
    }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* ============================================
   Font Awesome Fix
   ============================================ */

/* Force icon display */
.fa,
.fa-regular,
.fa-solid,
.fa-brands,
.far,
.fas,
.fab {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* Ensure fonts are applied */
.fa-regular {
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 400 !important;
}

.fa-solid {
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
}

.fa-brands {
    font-family: 'Font Awesome 6 Brands' !important;
    font-weight: 400 !important;
}

/* If icons still missing, try fallback */
.fa-magnifying-glass:before {
    content: "\f002" !important;
}
.fa-arrow-right:before {
    content: "\f061" !important;
}
.fa-arrow-left:before {
    content: "\f060" !important;
}
.fa-folder-open:before {
    content: "\f07c" !important;
}
.fa-user:before {
    content: "\f007" !important;
}
.fa-pen-to-square:before {
    content: "\f044" !important;
}
.fa-comment-dots:before {
    content: "\f4ad" !important;
}
.fa-magnifying-glass:before {
    content: "\f002" !important;
}
.fa-regular.fa-magnifying-glass:before {
    content: "\f002" !important;
}

/* ============================================
   Footer – New Design
   ============================================ */
.site-footer {
    background: #0A1628;
    color: #A0A2A6;
    padding: 2.5rem 0 1.5rem;
    margin-top: 3rem;
    border-top: 1px solid #1E2A3A;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-brand {
    flex: 0 0 auto;
}

.footer-tagline {
    font-size: 0.8rem;
    color: #315C52;
    margin: 0.2rem 0 0;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    flex: 1;
    justify-content: center;
}

.footer-links a {
    color: #D8D5CC;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #F7F6F2;
}

.footer-copy {
    flex: 0 0 auto;
    font-size: 0.8rem;
    color: #5F6368;
    text-align: right;
}

.footer-copy p {
    margin: 0;
}

/* Mobile */
@media (max-width: 768px) {
    .footer-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 0.6rem;
    }
    .footer-copy {
        text-align: center;
    }
}

/* ============================================
   FOOTER – New Design
   ============================================ */
.site-footer {
    background: #0A1628;
    color: #A0A2A6;
    padding: 2.5rem 0 1.5rem;
    margin-top: 3rem;
    border-top: 1px solid #1E2A3A;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-brand {
    flex: 0 0 auto;
}

.footer-tagline {
    font-size: 0.8rem;
    color: #315C52;
    margin: 0.2rem 0 0;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    flex: 1;
    justify-content: center;
}

.footer-links a {
    color: #D8D5CC;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #F7F6F2;
}

.footer-copy {
    flex: 0 0 auto;
    font-size: 0.8rem;
    color: #5F6368;
    text-align: right;
}

.footer-copy p {
    margin: 0;
}

/* Mobile */
@media (max-width: 768px) {
    .footer-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 0.6rem;
    }
    .footer-copy {
        text-align: center;
    }
}

/* ============================================
   Footer – New Design
   ============================================ */
.site-footer {
    background: #0A1628;
    color: #A0A2A6;
    padding: 2.5rem 0 1.5rem;
    margin-top: 3rem;
    border-top: 1px solid #1E2A3A;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-brand {
    flex: 0 0 auto;
}

.footer-tagline {
    font-size: 0.8rem;
    color: #315C52;
    margin: 0.2rem 0 0;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    flex: 1;
    justify-content: center;
}

.footer-links a {
    color: #D8D5CC;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #F7F6F2;
}

.footer-copy {
    flex: 0 0 auto;
    font-size: 0.8rem;
    color: #5F6368;
    text-align: right;
}

.footer-copy p {
    margin: 0;
}

/* Mobile */
@media (max-width: 768px) {
    .footer-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 0.6rem;
    }
    .footer-copy {
        text-align: center;
    }
}
