/* 
   Maghsalty Application Official Website - Global CSS Stylesheet
   Theme: Modern Arabic Web Design (RTL-First, Responsive, High Legibility)
   Colors: Dark Navy, Sky Blue, Accent Red
*/

@font-face {
    font-family: 'Qatar2022Arabic';
    src: url('../../Qatar2022Arabic-Thin.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Qatar2022Arabic';
    src: url('../../Qatar2022Arabic-Book.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Qatar2022Arabic';
    src: url('../../Qatar2022Arabic-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Qatar2022Arabic';
    src: url('../../Qatar2022Arabic-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Qatar2022Arabic';
    src: url('../../Qatar2022Arabic-Heavy.otf') format('opentype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Brand Colors */
    --primary: hsl(220, 60%, 15%);       /* Dark Navy */
    --primary-light: hsl(220, 50%, 25%);
    --accent: hsl(199, 89%, 48%);        /* Sky Blue */
    --accent-hover: hsl(199, 89%, 40%);
    --accent-light: hsl(199, 80%, 95%);
    --danger: hsl(0, 84%, 60%);          /* Soft Crimson Red */
    --danger-hover: hsl(0, 84%, 50%);
    --success: hsl(142, 70%, 45%);       /* Emerald Green */
    
    /* Neutral Colors */
    --bg-main: hsl(210, 40%, 98%);       /* Very light grey/blue */
    --bg-card: hsl(0, 0%, 100%);         /* Pure white */
    --text-dark: hsl(220, 40%, 15%);     /* Near black */
    --text-muted: hsl(220, 20%, 45%);    /* Muted grey */
    --border-color: hsl(220, 30%, 90%);
    
    /* Layout Constants */
    --max-width: 1200px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 18px;
    --border-radius-sm: 12px;
    --border-radius-lg: 32px;
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 8px 16px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 16px 32px rgba(15, 23, 42, 0.08);
}

/* Reset and Core Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-family: 'Qatar2022Arabic', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    scroll-behavior: smooth;
    background-color: var(--bg-main);
    color: var(--text-dark);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--primary);
    line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; position: relative; display: inline-block; }
h3 { font-size: 1.4rem; margin-bottom: 1rem; }
p { font-size: 1rem; color: var(--text-muted); font-weight: 400; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--accent-hover);
}

/* Focus state for keyboard navigation */
a:focus-visible, 
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
    border-radius: var(--border-radius-sm);
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 5rem 0;
}

.section-alt {
    background-color: var(--bg-card);
    border-radius: 40px;
    margin: 4rem auto;
    width: calc(100% - 3rem);
    max-width: var(--max-width);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

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

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1.75rem;
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--bg-card);
}
.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background-color: var(--accent);
    color: var(--bg-card);
}
.btn-accent:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background-color: var(--primary);
    color: var(--bg-card);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--bg-card);
}
.btn-danger:hover {
    background-color: var(--danger-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.2);
}

/* Header & Navigation */
.header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1060;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.header-scrolled {
    box-shadow: var(--shadow-sm);
    background-color: rgba(255, 255, 255, 0.95);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 75px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

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

.nav-link {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 0.25rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--accent);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--accent);
    font-weight: 700;
}

/* Hamburger Menu Button */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1100;
}

.hamburger-box {
    display: inline-block;
    width: 24px;
    height: 24px;
    position: relative;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
    width: 24px;
    height: 2.5px;
    background-color: var(--primary);
    position: absolute;
    border-radius: 4px;
    transition: transform 0.15s ease, opacity 0.15s ease;
    left: 0;
}

.hamburger-inner {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger-inner::before {
    content: '';
    top: -8px;
}

.hamburger-inner::after {
    content: '';
    top: 8px;
}

/* Hamburger Active State */
.hamburger.active .hamburger-inner {
    transform: rotate(45deg);
}

.hamburger.active .hamburger-inner::before {
    top: 0;
    opacity: 0;
}

.hamburger.active .hamburger-inner::after {
    top: 0;
    transform: rotate(-90deg);
}

/* Mobile Sidebar Styles */
.mobile-nav {
    position: fixed;
    top: 0;
    bottom: 0;
    right: -100%;
    width: 280px;
    background-color: var(--bg-card);
    z-index: 1050;
    padding: 85px 2rem 2rem 2rem;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    list-style: none;
}

.mobile-nav.active {
    right: 0;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav .nav-link {
    font-size: 1.15rem;
    padding: 0.5rem 0;
    display: block;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 6rem 0 4rem 0;
    overflow: hidden;
    background: radial-gradient(circle at 10% 20%, rgba(14, 165, 233, 0.05) 0%, rgba(255, 255, 255, 0) 60%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.hero-content h1 span {
    color: var(--accent);
}

.hero-content p {
    font-size: 1.15rem;
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(15, 23, 42, 0.1));
    border-radius: var(--border-radius-lg);
}

/* About / Intro Section */
.about-section {
    position: relative;
    background-color: var(--bg-card);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 4rem;
    align-items: center;
}

.about-graphic {
    width: 100%;
    display: flex;
    justify-content: center;
}

.about-graphic img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-lg);
    filter: drop-shadow(0 12px 24px rgba(15, 23, 42, 0.05));
}

.about-text h2::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 0;
    width: 60px;
    height: 4px;
    background-color: var(--accent);
    border-radius: 2px;
}

.about-text p {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    line-height: 1.9;
}

/* App Core Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.feature-img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    margin-bottom: 1.5rem;
}

/* User Types Section */
.user-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.user-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 3rem 2.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.user-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 6px;
    background-color: var(--primary);
    transition: var(--transition);
}

.user-card-client::before {
    background-color: var(--accent);
}

.user-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.user-card-img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    margin: 0 auto 2rem auto;
    display: block;
}

.user-card h3 {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
}

.user-features-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-features-list li {
    font-size: 1.05rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-features-list li::before {
    content: '✓';
    color: var(--accent);
    font-weight: bold;
    font-size: 1.1rem;
}

/* How It Works Section */
.how-it-works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.step-card {
    text-align: center;
    padding: 2rem 1.5rem;
    position: relative;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--bg-card);
    font-weight: 700;
    font-size: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}

.step-card:nth-child(even) .step-number {
    background-color: var(--accent);
}

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

.step-card p {
    font-size: 0.95rem;
}

/* Google Login Information Section */
.google-info-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 3.5rem 3rem;
    margin-top: 2rem;
    box-shadow: var(--shadow-md);
}

.google-flex {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.google-icon-box {
    width: 60px;
    height: 60px;
    background-color: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.google-icon-box svg {
    width: 32px;
    height: 32px;
}

.google-info-card p {
    font-size: 1.1rem;
    line-height: 1.9;
    margin-bottom: 2rem;
}

/* Privacy & Security banner */
.security-banner {
    background-color: var(--primary);
    color: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 4rem 3rem;
    text-align: center;
}

.security-banner h2 {
    color: var(--bg-card);
    font-size: 2.2rem;
}

.security-banner p {
    color: hsl(220, 20%, 80%);
    font-size: 1.15rem;
    max-width: 800px;
    margin: 0 auto 2.5rem auto;
}

.security-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Support & FAQ Page Styles */
.faq-container {
    max-width: 800px;
    margin: 3rem auto 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.faq-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.faq-trigger {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem;
    text-align: right;
    font-family: inherit;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.faq-arrow {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--primary);
    stroke-width: 2.5;
    transition: var(--transition);
}

.faq-item.active .faq-arrow {
    transform: rotate(180deg);
    stroke: var(--accent);
}

.faq-item.active .faq-trigger {
    color: var(--accent);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.faq-content-inner {
    padding: 0 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid transparent;
    color: var(--text-dark);
    font-size: 1rem;
}

.faq-item.active .faq-content {
    max-height: 500px; /* high enough to cover all text content */
}

.faq-item.active .faq-content-inner {
    border-top-color: var(--border-color);
}

/* Static Form / Support Page Mail Block */
.support-block {
    max-width: 600px;
    margin: 4rem auto 0 auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 3rem 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.support-email-box {
    direction: ltr;
    display: inline-flex;
    align-items: center;
    background-color: var(--bg-main);
    border: 1px dashed var(--accent);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary);
    margin: 1.5rem 0 2rem 0;
    word-break: break-all;
}

/* Policy Content Pages (Privacy, Terms, Delete Account) */
.policy-page {
    padding: 4rem 0 6rem 0;
    background-color: var(--bg-card);
    flex-grow: 1;
}

.policy-card {
    max-width: 900px;
    margin: 0 auto;
}

.policy-card h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.policy-date {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    border-bottom: 2px solid var(--bg-main);
    padding-bottom: 1.5rem;
}

.policy-body {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.policy-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.policy-section h2 {
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 0;
}

.policy-section p, 
.policy-section ul {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-dark);
}

.policy-section ul {
    padding-right: 1.5rem;
}

.policy-section li {
    margin-bottom: 0.5rem;
}

/* Account deletion card style */
.delete-account-card {
    background-color: var(--bg-main);
    border-right: 5px solid var(--danger);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-top: 1.5rem;
}

.delete-steps {
    list-style: decimal;
    padding-right: 1.5rem;
    margin: 1.5rem 0;
}

.delete-steps li {
    margin-bottom: 0.75rem;
    font-weight: 500;
}

/* 404 Page */
.error-page-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5rem 0;
}

.error-card {
    text-align: center;
    max-width: 500px;
    padding: 3rem;
    background-color: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.error-code {
    font-size: 6rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 1rem;
}

.error-card h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.error-card p {
    margin-bottom: 2.5rem;
}

/* Footer Style */
.footer {
    background-color: var(--primary);
    color: var(--bg-card);
    padding: 5rem 0 2rem 0;
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.footer-logo {
    height: 48px;
    width: auto;
    align-self: flex-start;
}

.footer-brand p {
    color: hsl(220, 20%, 75%);
    font-size: 0.95rem;
    line-height: 1.7;
}

.footer-links-title {
    color: var(--bg-card);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
}

.footer-links-title::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 0;
    width: 30px;
    height: 2.5px;
    background-color: var(--accent);
    border-radius: 2px;
}

.footer-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-link {
    color: hsl(220, 20%, 80%);
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-block;
}

.footer-link:hover {
    color: var(--accent);
    transform: translateX(-4px);
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-contact-item {
    font-size: 0.95rem;
    color: hsl(220, 20%, 80%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-contact-item a {
    color: hsl(220, 20%, 80%);
    direction: ltr;
}

.footer-contact-item a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid var(--primary-light);
    padding-top: 2rem;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.9rem;
    color: hsl(220, 20%, 70%);
}

/* Media Queries for Responsiveness */
@media (max-width: 992px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    .section { padding: 4rem 0; }
    
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-image-wrapper {
        order: -1;
    }
    
    .hero-img {
        max-width: 320px;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }
    
    .about-text h2::after {
        right: 50%;
        transform: translateX(50%);
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
    
    .footer-brand {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .hamburger {
        display: block;
    }

    .section-alt {
        border-radius: 28px;
        margin: 2.5rem auto;
        width: calc(100% - 2rem);
    }

    .footer {
        border-top-left-radius: 28px;
        border-top-right-radius: 28px;
        margin-top: 2.5rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-brand {
        grid-column: span 1;
    }
    
    .security-banner {
        padding: 3rem 1.5rem;
    }
    
    .security-banner h2 {
        font-size: 1.8rem;
    }
    
    .google-info-card {
        padding: 2rem 1.5rem;
    }
    
    .google-flex {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .google-icon-box {
        margin: 0 auto;
    }
    
    .policy-card h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.8rem; }
    .hero-content h1 { font-size: 2rem; }
    .hero-actions {
        flex-direction: column;
    }
    .hero-actions .btn {
        width: 100%;
    }
    .user-types-grid {
        grid-template-columns: 1fr;
    }
}
