/* Tawthiq Landing Page Styles */
/* Optimized and organized for better maintainability */

:root {
    --green: #059669;
    --green-700: #047857;
    --blue: #2563eb;
    --blue-700: #1d4ed8;
    --ink: #1f2937;
    --muted: #6b7280;
    --wash: #f8fafc;
    --glass: rgba(255, 255, 255, .08);
    --border: rgba(255, 255, 255, .18);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.7;
    color: var(--ink);
    min-height: 100vh;
    background: radial-gradient(1200px 600px at 100% -10%, rgba(37, 99, 235, .45), transparent),
                radial-gradient(1000px 600px at -10% 110%, rgba(5, 150, 105, .45), transparent),
                linear-gradient(135deg, #022c22 0%, #0b2c7c 100%);
}

/* ==========================================
   UTILITIES & BASE STYLES
   ========================================== */

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

.btn {
    padding: .8rem 1.3rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 800;
    border: 0;
    cursor: pointer;
    display: inline-block;
    font-family: 'Cairo', sans-serif;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--green), #10b981);
    color: #fff;
    box-shadow: 0 10px 30px rgba(16, 185, 129, .25);
    justify-content: center;
    align-items: center;
    display: inline-flex;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #10b981, #34d399);
}

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

.btn-secondary:hover {
    background: #ffffff1a;
}

/* Reveal animation utility */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .8s ease, transform .8s ease;
}

.reveal.show {
    opacity: 1;
    transform: none;
}

/* ==========================================
   BACKGROUND ORBS
   ========================================== */

.orbs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
    filter: blur(40px);
    opacity: .55;
}

.orb {
    position: absolute;
    border-radius: 9999px;
    will-change: transform;
    mix-blend-mode: screen;
}

.orb.o1 {
    width: 380px;
    height: 380px;
    background: #10b98122;
    right: 5%;
    top: 8%;
    animation: float 16s ease-in-out infinite;
}

.orb.o2 {
    width: 520px;
    height: 520px;
    background: #3b82f622;
    left: 0%;
    bottom: 0%;
    animation: float 22s ease-in-out infinite reverse;
}

.orb.o3 {
    width: 280px;
    height: 280px;
    background: #22d3ee22;
    left: 35%;
    top: 55%;
    animation: float 18s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    50% {
        transform: translateY(-30px) translateX(15px);
    }
}

/* ==========================================
   HEADER
   ========================================== */

.header {
    position: fixed;
    inset-inline: 0;
    top: 0;
    z-index: 50;
    transition: all .35s ease;
    background: transparent;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.logo span {
    display: inline-block;
}

.nav-links {
    display: flex;
    gap: 1.25rem;
    list-style: none;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    opacity: .95;
}

.auth-buttons {
    display: flex;
    gap: .75rem;
}

/* Header scrolled state */
.scrolled {
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .08);
}

.scrolled .logo {
    color: var(--green);
}

.scrolled .logo span {
    color: var(--green);
}

.scrolled .logo img {
    filter: brightness(0) saturate(100%) invert(27%) sepia(94%) saturate(1553%) hue-rotate(132deg) brightness(95%) contrast(91%);
}

.scrolled .nav-links a {
    color: var(--ink);
}

.scrolled .btn-secondary {
    color: var(--green);
    border-color: var(--green);
}

/* ==========================================
   HERO SECTION
   ========================================== */

.hero {
    padding: 9rem 0 4rem;
    text-align: center;
    color: #fff;
}

.hero h1 {
    font-size: 3.4rem;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: .3px;
    background: linear-gradient(90deg, #fff, #d1fae5);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    max-width: 720px;
    margin: 1rem auto 2rem;
    font-size: 1.2rem;
    opacity: .95;
}

.hero-cta {
    display: flex;
    gap: .8rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* App download buttons */
.app-download-buttons {
    display: flex;
    gap: .8rem;
    justify-content: center;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.app-btn {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1.25rem;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    backdrop-filter: blur(8px);
    min-width: 190px;
    justify-content: center;
}

.app-btn:hover {
    transform: translateY(-2px);
}

.app-btn i {
    font-size: 1.4rem;
}

.google-play {
    background: linear-gradient(135deg, var(--green), #10b981);
}

.apk-download {
    background: linear-gradient(135deg, var(--blue), #3b82f6);
}

.app-btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.app-btn-label {
    font-size: .75rem;
    opacity: .8;
}

.app-btn-name {
    font-size: .9rem;
}

/* Trust badges */
.trust-badges {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.badge {
    background: #ffffff0f;
    border: 1px solid #ffffff2b;
    color: #fff;
    padding: .4rem .75rem;
    border-radius: 999px;
    font-size: .9rem;
}

/* ==========================================
   FEATURES SECTION
   ========================================== */

.features {
    padding: 5rem 0;
    background: #fff;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    margin-top: 2rem;
}

.section-title {
    text-align: center;
    font-size: 2.3rem;
    font-weight: 900;
    color: var(--ink);
}

.section-sub {
    color: var(--muted);
    text-align: center;
    margin-top: .5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.4rem;
    margin-top: 2.4rem;
}

.feature-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    padding: 2rem 1.75rem;
    border-radius: 20px;
    border: 1px solid rgba(229, 231, 235, 0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.feature-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--green), var(--blue), #8b5cf6);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(5, 150, 105, 0.15), 0 10px 20px rgba(37, 99, 235, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.feature-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.feature-card:hover .feature-shine {
    opacity: 1;
    animation: shine 1.5s ease-in-out;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.feature-icon {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.6rem;
    margin: 0 auto 1.25rem;
    position: relative;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.icon-gradient-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.icon-gradient-2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.icon-gradient-3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.icon-gradient-4 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.icon-gradient-5 {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.icon-gradient-6 {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.feature-card h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: var(--ink);
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
    text-align: center;
    width: 100%;
}

.feature-card:hover h3 {
    color: var(--green);
}

.feature-card p {
    color: var(--muted);
    line-height: 1.7;
    position: relative;
    z-index: 1;
    font-size: 0.98rem;
    text-align: center;
    width: 100%;
}

/* ==========================================
   STATS SECTION
   ========================================== */

.stats {
    padding: 4rem 0;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #fff;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.4rem;
    text-align: center;
}

.stat-item h3 {
    font-size: 2.3rem;
    font-weight: 900;
    color: #a7f3d0;
}

/* ==========================================
   PRICING SECTION
   ========================================== */

.pricing {
    padding: 5rem 0;
    background: #fff;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.2rem;
    margin-top: 2.2rem;
}

.price-card {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 1.6rem;
    background: #fafafa;
    transition: transform .2s ease, box-shadow .2s ease;
}

.price-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(2, 6, 23, .08);
}

.price-tag {
    font-size: 2rem;
    font-weight: 900;
    margin: .6rem 0;
}

.price-features {
    list-style: none;
    color: #374151;
    display: grid;
    gap: .45rem;
    margin: 1rem 0 1.2rem;
}

/* ==========================================
   CTA SECTION
   ========================================== */

.cta {
    padding: 5rem 0;
    background: #fff;
    text-align: center;
}

.cta h2 {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--ink);
}

.cta p {
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 680px;
    margin: .6rem auto 1.4rem;
}

/* ==========================================
   FOOTER
   ========================================== */

.footer {
    background: #111827;
    color: #e5e7eb;
    padding: 3rem 0 1.2rem;
}

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

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

.footer a:hover {
    color: #34d399;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1rem;
    text-align: center;
    color: #9ca3af;
}

/* ==========================================
   BACK TO TOP BUTTON
   ========================================== */

.to-top {
    position: fixed;
    inset-inline-end: 16px;
    bottom: 16px;
    background: #111827;
    color: #fff;
    border: 1px solid #ffffff2b;
    padding: .7rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease;
    z-index: 40;
}

.to-top.show {
    opacity: 1;
    transform: none;
}

/* ==========================================
   WHATSAPP FLOATING BUTTON
   ========================================== */

.whatsapp-float {
    position: fixed;
    inset-inline-start: 16px;
    bottom: 16px;
    background: #25d366;
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 4px 20px rgba(37, 211, 102, .3);
    z-index: 40;
    cursor: pointer;
    transition: all .3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    animation: whatsapp-bounce 2s ease-in-out infinite;
}

.whatsapp-float:hover {
    background: #128c7e;
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, .4);
}

.whatsapp-float:active {
    transform: scale(.95);
}

.whatsapp-float i {
    color: #fff;
    font-size: 28px;
}

/* WhatsApp tooltip */
.whatsapp-float::before {
    content: "تواصل معنا عبر واتساب\Aللحصول على المساعدة والدعم";
    position: absolute;
    inset-inline-end: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    white-space: pre-line;
    opacity: 0;
    visibility: hidden;
    transition: all .3s ease;
    z-index: 50;
    min-width: 160px;
    text-align: center;
    line-height: 1.4;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tooltip-arrow {
    position: absolute;
    inset-inline-end: 60px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-inline-start-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: all .3s ease;
    z-index: 50;
}

.whatsapp-float:hover::before,
.whatsapp-float:hover .tooltip-arrow {
    opacity: 1;
    visibility: visible;
}

/* WhatsApp pulse animation */
.whatsapp-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #25d366;
    opacity: .6;
    animation: pulse 2s ease-in-out infinite;
    z-index: -1;
}

.whatsapp-float:hover .whatsapp-pulse {
    animation: none;
}

/* WhatsApp label */
.whatsapp-label {
    position: absolute;
    top: 50%;
    inset-inline-start: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .3s ease;
    z-index: 30;
    pointer-events: none;
}

.whatsapp-float:hover .whatsapp-label {
    opacity: 1;
}

/* WhatsApp animations */
@keyframes whatsapp-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: .6;
    }
    50% {
        transform: scale(1.2);
        opacity: .3;
    }
    100% {
        transform: scale(1);
        opacity: .6;
    }
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

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

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.05rem;
    }

    .whatsapp-float {
        width: 55px;
        height: 55px;
        inset-inline-start: 12px;
        bottom: 12px;
    }

    .whatsapp-float i {
        font-size: 24px;
    }

    .whatsapp-float::before {
        font-size: 11px;
        padding: 8px 12px;
        inset-inline-end: 65px;
        min-width: 140px;
    }

    .whatsapp-label {
        font-size: 8px;
        padding: 2px 5px;
    }
}

/* ==========================================
   ACCESSIBILITY & REDUCED MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    .reveal {
        transition: none;
    }

    .orb {
        animation: none;
    }

    .btn,
    .feature-card,
    .price-card {
        transition: none;
    }

    .whatsapp-float {
        animation: none;
    }

    .whatsapp-pulse {
        animation: none;
    }
}

/* Focus styles for accessibility */
.btn:focus,
.nav-links a:focus,
.whatsapp-float:focus {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid #fff;
    }

    .feature-card {
        border: 2px solid var(--ink);
    }
}
