/* CSS Variables */
:root {
    --background: 200 20% 98%;
    --foreground: 200 25% 10%;
    --card: 0 0% 100%;
    --card-foreground: 200 25% 10%;
    --primary: 174 62% 40%;
    --primary-foreground: 0 0% 100%;
    --secondary: 200 60% 94%;
    --secondary-foreground: 200 25% 15%;
    --muted: 200 20% 95%;
    --muted-foreground: 200 10% 45%;
    --accent: 195 70% 45%;
    --border: 200 20% 90%;
    --medical-dark: 200 25% 12%;
    --medical-teal: 174 62% 55%;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.6;
    overflow-x: hidden;
}

.font-body {
    font-family: 'Inter', sans-serif;
}

/* Utility Classes */
.gradient-text {
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.medical-gradient {
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
}

.medical-shadow {
    box-shadow: 0 4px 20px -4px hsl(200 25% 10% / 0.08);
}

.medical-shadow-lg {
    box-shadow: 0 10px 40px -10px hsl(200 25% 10% / 0.12);
}

.medical-shadow-hover {
    box-shadow: 0 20px 50px -12px hsl(174 62% 40% / 0.25);
}

.medical-shadow-3d {
    box-shadow: 0 25px 60px -15px hsl(200 25% 10% / 0.15);
}

.icon {
    width: 1.25rem;
    height: 1.25rem;
}

.icon-primary {
    color: hsl(var(--medical-teal));
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
    color: hsl(var(--primary-foreground));
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px -5px hsl(174 62% 40% / 0.3);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    border-radius: 1rem;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: 1rem;
    border: 2px solid hsl(var(--primary-foreground) / 0.2);
    color: hsl(var(--primary-foreground));
    font-weight: 600;
    font-size: 1.125rem;
    text-decoration: none;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: hsl(var(--primary-foreground) / 0.1);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    transition: all 0.5s ease;
    animation: slideDown 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.navbar.scrolled,
.navbar.not-home {
    background: hsl(var(--card) / 0.8);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px -4px hsl(200 25% 10% / 0.08);
    border-bottom: 1px solid hsl(var(--border) / 0.5);
}

.nav-container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4.5rem;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    isolation: isolate;
    background: transparent;
    padding: 0.62rem 1.7rem 0.66rem 0.8rem;
    animation: logoBlobFloat 7s ease-in-out infinite;
}

.logo-link::before,
.logo-link::after {
    content: '';
    position: absolute;
    pointer-events: none;
    z-index: -1;
}

.logo-link::before {
    inset: -0.24rem -0.95rem -0.28rem -0.75rem;
    background-image: url('https://agromonitoring.com/themes/agri-new/assets/img/path4.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: drop-shadow(0 8px 22px hsl(0 0% 0% / 0.17));
    transform-origin: center;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.logo-link::after {
    display: none;
}

.logo-link:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: none;
}

.navbar.scrolled .logo-link::before,
.navbar.not-home .logo-link::before {
    opacity: 0;
}

@keyframes logoBlobFloat {
    0%,
    100% {
        border-radius: 58% 42% 62% 38% / 45% 58% 42% 55%;
    }
    50% {
        border-radius: 46% 54% 40% 60% / 62% 43% 57% 38%;
    }
}

.logo-img {
    height: 2.5rem;
    object-fit: contain;
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.logo-icon span {
    color: hsl(var(--primary-foreground));
    font-weight: 700;
    font-size: 0.875rem;
}

.logo-text {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.05rem;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
    line-height: 1;
}

.logo-text-en {
    display: block;
    font-weight: 700;
    font-size: 1.125rem;
    color: hsl(0 72% 51%);
}

.logo-text-ar {
    display: block;
    width: 100%;
    font-family: 'Cairo', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1;
    color: hsl(207 90% 48%);
    white-space: nowrap;
    direction: rtl;
    text-align: justify;
    text-align-last: justify;
}

.navbar:not(.scrolled):not(.not-home) .logo-text-en {
    color: hsl(0 72% 51%);
}

.nav-links {
    display: none;
    align-items: center;
    gap: 0.125rem;
}

@media (min-width: 1024px) {
    .nav-links {
        display: flex;
    }
}

.nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    transition: all 0.3s ease;
}

.navbar:not(.scrolled):not(.not-home) .nav-link {
    color: hsl(var(--primary-foreground) / 0.7);
}

.nav-link:hover,
.nav-link.active {
    color: hsl(var(--foreground));
}

.navbar:not(.scrolled):not(.not-home) .nav-link:hover,
.navbar:not(.scrolled):not(.not-home) .nav-link.active {
    color: hsl(var(--primary-foreground));
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.5rem;
    right: 0.5rem;
    height: 2px;
    border-radius: 1px;
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
    animation: slideIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideIn {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

.nav-links .btn-primary {
    margin-left: 1rem;
}

/* Mobile Toggle */
.mobile-toggle {
    display: block;
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

@media (min-width: 1024px) {
    .mobile-toggle {
        display: none;
    }
}

.hamburger-line {
    position: absolute;
    left: 0.5rem;
    display: block;
    width: 1.5rem;
    height: 2px;
    background: hsl(var(--foreground));
    transition: all 0.3s ease;
}

.navbar:not(.scrolled):not(.not-home) .hamburger-line {
    background: hsl(var(--primary-foreground));
}

.hamburger-line:nth-child(1) {
    top: 0.75rem;
}

.hamburger-line:nth-child(2) {
    top: 1.125rem;
}

.hamburger-line:nth-child(3) {
    top: 1.5rem;
}

.mobile-toggle.active .hamburger-line:nth-child(1) {
    top: 1.125rem;
    transform: rotate(45deg);
}

.mobile-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active .hamburger-line:nth-child(3) {
    top: 1.125rem;
    transform: rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    background: hsl(var(--card) / 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid hsl(var(--border) / 0.5);
    overflow: hidden;
}

@media (min-width: 1024px) {
    .mobile-menu {
        display: none !important;
    }
}

.mobile-menu.active {
    display: block;
    animation: slideDownMenu 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideDownMenu {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.mobile-menu-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mobile-link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-link:hover,
.mobile-link.active {
    background: hsl(var(--secondary));
    color: hsl(var(--primary));
}

.mobile-cta {
    margin-top: 1rem;
    text-align: center;
    justify-content: center;
}

/* Footer */
.footer {
    background: hsl(var(--medical-dark));
    color: hsl(var(--primary-foreground));
}

.footer-cta {
    border-bottom: 1px solid hsl(var(--primary-foreground) / 0.1);
}

.footer-container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 4rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .footer-container {
        flex-direction: row;
    }
}

.footer-cta-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: hsl(var(--primary-foreground));
    line-height: 1.2;
}

@media (min-width: 1024px) {
    .footer-cta-title {
        font-size: 2.25rem;
    }
}

.footer-cta-desc {
    color: hsl(var(--primary-foreground) / 0.5);
    font-family: 'Inter', sans-serif;
    margin-top: 0.5rem;
}

.footer-main {
    padding: 4rem 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 640px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.footer-logo .logo-text {
    gap: 0.18rem;
}

.footer-logo .logo-text-en {
    font-size: 1.75rem;
}

.footer-logo .logo-text-ar {
    font-size: 1.75rem;
}

.footer-logo-img {
    width: 4rem;
    height: 4rem;
    object-fit: contain;
}

.footer-social-icons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.social-icon-link {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: hsl(var(--primary-foreground) / 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid hsl(var(--primary-foreground) / 0.1);
}

.social-icon-link svg {
    width: 1.25rem;
    height: 1.25rem;
    color: hsl(var(--primary-foreground) / 0.7);
    transition: color 0.3s ease;
}

.social-icon-link:hover {
    background: hsl(var(--primary));
    border-color: hsl(var(--primary));
    transform: translateY(-0.25rem);
}

.social-icon-link:hover svg {
    color: hsl(var(--primary-foreground));
}

.social-icon-link.social-whatsapp svg {
    color: #25d366;
}

.social-icon-link.social-instagram svg {
    color: #e1306c;
}

.social-icon-link.social-facebook svg {
    color: #1877f2;
}

.social-icon-link.social-whatsapp:hover {
    background: hsl(142 70% 20% / 0.45);
    border-color: #25d366;
}

.social-icon-link.social-instagram:hover {
    background: hsl(330 70% 20% / 0.45);
    border-color: #e1306c;
}

.social-icon-link.social-facebook:hover {
    background: hsl(217 80% 20% / 0.45);
    border-color: #1877f2;
}

.social-icon-link.social-whatsapp:hover svg {
    color: #25d366;
}

.social-icon-link.social-instagram:hover svg {
    color: #e1306c;
}

.social-icon-link.social-facebook:hover svg {
    color: #1877f2;
}

.floating-whatsapp {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 999px;
    background: #25d366;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 30px hsl(142 60% 22% / 0.5);
    border: 2px solid #ffffff;
    z-index: 70;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: whatsappFloat 2.8s ease-in-out infinite;
}

.floating-whatsapp svg {
    width: 1.8rem;
    height: 1.8rem;
}

.floating-whatsapp:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 18px 32px hsl(142 60% 20% / 0.6);
}

@keyframes whatsappFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@media (max-width: 640px) {
    .floating-whatsapp {
        right: 1rem;
        bottom: 1rem;
        width: 3.1rem;
        height: 3.1rem;
    }

    .floating-whatsapp svg {
        width: 1.65rem;
        height: 1.65rem;
    }
}

.footer-desc {
    color: hsl(var(--primary-foreground) / 0.5);
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

.footer-heading {
    font-weight: 600;
    color: hsl(var(--primary-foreground));
    margin-bottom: 1rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: hsl(var(--primary-foreground) / 0.5);
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: hsl(var(--primary-foreground));
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
}

.contact-item svg {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.contact-item p {
    color: hsl(var(--primary-foreground) / 0.5);
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid hsl(var(--primary-foreground) / 0.1);
    color: hsl(var(--primary-foreground) / 0.6);
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    border-color: hsl(var(--primary) / 0.5);
    color: hsl(var(--primary-foreground));
}

.footer-hours {
    margin-top: 1.5rem;
}

.hours-label {
    color: hsl(var(--primary-foreground) / 0.3);
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.hours-time {
    color: hsl(var(--primary-foreground) / 0.6);
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
}

.footer-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, hsl(var(--primary-foreground) / 0.1), transparent);
    margin: 3rem 0 1.5rem;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

@media (min-width: 640px) {
    .footer-bottom {
        flex-direction: row;
    }
}

.copyright,
.designed {
    color: hsl(var(--primary-foreground) / 0.3);
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-up {
    animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.fade-in {
    animation: fadeIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Scroll Reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.scroll-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.scroll-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* Enhanced scroll animations */
.scroll-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.scroll-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Stagger animation for children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.stagger-children.revealed > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.stagger-children.revealed > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger-children.revealed > *:nth-child(3) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger-children.revealed > *:nth-child(4) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger-children.revealed > *:nth-child(5) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.stagger-children.revealed > *:nth-child(6) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }

/* Continuous subtle animations */
@keyframes pulse-gentle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-pulse-gentle {
    animation: pulse-gentle 3s ease-in-out infinite;
}

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

.animate-float {
    animation: float 4s ease-in-out infinite;
}
