/*=================================
  Global & Reset Styles
=================================*/
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    direction: rtl;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

/*=================================
  Dark Mode (Note: In YOUR setup, 
  "body.dark-mode" is actually Light Mode)
=================================*/
body.dark-mode {
    background-color: #f0f0f0;
    color: #121212;
}

/* Navbar in Dark Mode */
body.dark-mode .navbar {
    background: rgba(240, 240, 240, 0.9);
    color: #121212;
}

body.dark-mode .navbar.scrolled {
    background: rgba(240, 240, 240, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

body.dark-mode .navbar .nav-links a {
    color: #121212;
}

body.dark-mode .navbar .logo-text {
    color: #2ecc71;
}

/* Hero in Dark Mode */
body.dark-mode .hero {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

/* Features in Dark Mode */
body.dark-mode .features {
    background-color: #f9f9f9;
}

body.dark-mode .features .feature-card {
    background-color: #ffffff;
    color: #121212;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Platforms in Dark Mode */
body.dark-mode .platforms {
    background-color: #f0f0f0;
}

/* CTA in Dark Mode */
body.dark-mode .cta {
    background-color: #27ae60;
}

body.dark-mode .cta h2::after {
    background-color: #121212;
}

/* Footer in Dark Mode */
body.dark-mode .footer {
    background-color: #ffffff;
    color: #121212;
}

/* FAQ in Dark Mode */
body.dark-mode .faq {
    background-color: #f9f9f9;
}

/* Text Colors in Dark Mode */
body.dark-mode .hero-content h1,
body.dark-mode .hero-content p,
body.dark-mode .feature-card h3,
body.dark-mode .feature-card p,
body.dark-mode .platform-icon p,
body.dark-mode .cta h2,
body.dark-mode .cta p,
body.dark-mode .footer p,
body.dark-mode .footer .social-links a,
body.dark-mode .nav-links a,
body.dark-mode .faq h2,
body.dark-mode .faq .faq-item h3,
body.dark-mode .faq .faq-item p {
    color: #121212;
}

body.dark-mode .platform-icon p {
    color: #121212;
}

/* Buttons in Dark Mode */
body.dark-mode .cta-button {
    background-color: #333333;
    color: #ffffff;
}

body.dark-mode .cta-button:hover {
    background-color: #555555;
}

body.dark-mode .hero-content .cta-button {
    background-color: #4CAF50;
    color: #ffffff;
}

body.dark-mode .hero-content .cta-button:hover {
    background-color: #43a047;
}

body.dark-mode .footer .social-links a:hover {
    color: #4CAF50;
}

/* Back to Top in Dark Mode */
body.dark-mode .back-to-top {
    background-color: #4CAF50;
}

body.dark-mode .back-to-top:hover {
    background-color: #45a049;
}

/*=================================
  Preloader
=================================*/
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #4D6DE3;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 8px solid #f3f3f3;
    border-top: 8px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/*=================================
  WaterLoader
=================================*/
/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Fullscreen container for the water overlay, hidden initially */
.water-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    overflow: hidden;
    display: none;
    /* Hidden until the event fires */
    justify-content: center;
    align-items: center;
}

/* Fullscreen container for the draining water overlay, hidden by default */
.water-container-draining {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    overflow: hidden;
    display: none;
    /* Hidden until triggered */
    justify-content: center;
    align-items: center;
}

/* The water element */
.water {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #4D6DE3;
    transform: translateY(0%);
    /* Starts fully covering the screen */
}

/* Waves styling */
.water_wave {
    width: 200%;
    position: absolute;
    bottom: 100%;
}

.water_wave_back {
    right: 0;
    fill: #C7EEFF;
    animation: wave-back 1.4s infinite linear;
}

.water_wave_front {
    left: 0;
    fill: #4D6DE3;
    margin-bottom: -1px;
    animation: wave-front 0.7s infinite linear;
}

/* Keyframes for wave animations */
@keyframes wave-front {
    100% {
        transform: translate(-50%, 0);
    }
}

@keyframes wave-back {
    100% {
        transform: translate(50%, 0);
    }
}

/*=================================
  API Loader
=================================*/
.api-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

.api-loader .spinner {
    width: 60px;
    height: 60px;
    border: 8px solid #ccc;
    border-top: 8px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Reuse the same @keyframes "spin" defined above */

/*=================================
  Dark Mode Slider
=================================*/
.dark-mode-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-left: 15px;
    vertical-align: middle;
    cursor: pointer;
}

.dark-mode-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.dark-mode-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.dark-mode-toggle .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.dark-mode-toggle input:checked+.slider {
    background-color: #4CAF50;
}

.dark-mode-toggle input:checked+.slider:before {
    transform: translateX(26px);
}

/*=================================
  Hero Section
=================================*/
.hero {
    height: 100vh;
    background: linear-gradient(135deg, #4CAF50, #2ecc71);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    text-align: center;
    padding: 0 20px;
    overflow: hidden;
    background-attachment: fixed;
    background-size: cover;
    z-index: 1;
}

/* Particle Background */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 0;
    top: 0;
    left: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    animation: fadeIn 2s ease-in-out;
}

.hero-content img {
    width: 150px;
    height: 150px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.hero-content img:hover {
    transform: scale(1.1) rotate(10deg);
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-15px);
    }

    60% {
        transform: translateY(-7px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.hero-content h1 {
    font-size: 48px;
    color: #ffffff;
    margin-bottom: 15px;
    font-weight: 700;
    animation: slideIn 1s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.hero-content p {
    font-size: 20px;
    color: #f0f0f0;
    margin-bottom: 30px;
    animation: fadeIn 2s ease-in-out;
}

.hero-content .cta-button {
    padding: 15px 40px;
    font-size: 18px;
    color: #ffffff;
    background-color: #4CAF50;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    display: inline-block;
    animation: pulse 2s infinite;
    position: relative;
    overflow: hidden;
}

.hero-content .cta-button::before {
    content: '';
    position: absolute;
    width: 300%;
    height: 300%;
    background: rgba(255, 255, 255, 0.15);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hero-content .cta-button:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
}

.hero-content .cta-button:hover {
    background-color: #43a047;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/*=================================
  Features Section
=================================*/
.features {
    padding: 80px 20px;
    background-color: #1e1e2f;
    text-align: center;
}

.features h2 {
    font-size: 32px;
    color: #4CAF50;
    margin-bottom: 50px;
    position: relative;
    display: inline-block;
}

.features h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background-color: #4CAF50;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background-color: #2c2c4a;
    border-radius: 15px;
    padding: 30px 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(30px);
}

.feature-card[data-aos="fade-up"] {
    opacity: 1;
    transform: translateY(0);
}

.feature-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.3s ease;
}

.feature-card:hover::after {
    background: rgba(255, 255, 255, 0.1);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.feature-card img {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.feature-card:hover img {
    transform: scale(1.1);
}

.feature-card h3 {
    font-size: 22px;
    margin-bottom: 15px;
    font-weight: 700;
    color: #e0e0e0;
}

.feature-card p {
    font-size: 16px;
    color: #b0b0b0;
}

/*=================================
  Platforms Carousel
=================================*/
.platforms {
    padding: 80px 20px;
    background-color: #121212;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.platforms h2 {
    font-size: 32px;
    color: #4CAF50;
    margin-bottom: 50px;
    position: relative;
    display: inline-block;
}

.platforms h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background-color: #4CAF50;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.carousel {
    direction: ltr;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-bottom: 20px;
    padding-top: 20px;
}

.carousel-content {
    display: flex;
    gap: 40px;
}

.carousel-content.animate {
    animation: scroll 90s linear infinite;
    will-change: transform;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.platform-icon {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease;
    opacity: 0;
    transform: translateY(30px);
}

.platform-icon[data-aos="fade-up"] {
    opacity: 1;
    transform: translateY(0);
}

.platform-icon img {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.platform-icon:hover img {
    transform: scale(1.1);
}

.platform-icon p {
    font-size: 18px;
}

/*=================================
  CTA Section
=================================*/
.cta {
    padding: 80px 20px;
    background-color: #4CAF50;
    text-align: center;
}

.cta h2 {
    font-size: 32px;
    color: #ffffff;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.cta h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background-color: #ffffff;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.cta p {
    font-size: 20px;
    color: #f0f0f0;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.cta .cta-button {
    padding: 15px 40px;
    font-size: 18px;
    color: #ffffff;
    background-color: #333333;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.cta .cta-button::before {
    content: '';
    position: absolute;
    width: 300%;
    height: 300%;
    background: rgba(255, 255, 255, 0.15);
    top: 50%;
    left: 50%;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.cta .cta-button:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
}

.cta .cta-button:hover {
    background-color: #555555;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/*=================================
  FAQ Section
=================================*/
.faq {
    padding: 80px 20px;
    background-color: #1e1e2f;
    text-align: center;
}

.faq h2 {
    font-size: 32px;
    color: #4CAF50;
    margin-bottom: 50px;
    position: relative;
    display: inline-block;
}

.faq h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background-color: #4CAF50;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.faq .faq-item {
    background-color: #2c2c4a;
    border-radius: 50px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.faq .faq-item::before,
.faq .faq-item::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: #2c2c4a;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
}

.faq .faq-item::before {
    left: -20px;
}

.faq .faq-item::after {
    right: -20px;
}

.faq .faq-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.faq .faq-item h3 {
    font-size: 22px;
    margin-bottom: 0;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq .faq-item h3::after {
    content: '\f078';
    font-family: 'FontAwesome';
    transition: transform 0.2s ease;
}

.faq .faq-item.active h3::after {
    transform: rotate(180deg);
}

.faq .faq-item p {
    font-size: 16px;
    color: #b0b0b0;
    line-height: 1.8;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
}

.faq .faq-item.active p {
    max-height: 500px;
    margin-top: 15px;
}

.faq .faq-item .controller-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    opacity: 0.2;
}

.faq .faq-item .controller-icon img {
    width: 100%;
    height: 100%;
}

/* FAQ in "Dark Mode" (light theme) */
body.dark-mode .faq {
    background-color: #f9f9f9;
}

body.dark-mode .faq .faq-item {
    background-color: #ffffff;
}

body.dark-mode .faq .faq-item::before,
body.dark-mode .faq .faq-item::after {
    background-color: #ffffff;
}

body.dark-mode .faq .faq-item h3,
body.dark-mode .faq .faq-item p {
    color: #121212;
}

/*=================================
  Footer
=================================*/
.footer {
    background-color: #121212;
    padding: 20px;
    text-align: center;
    color: #e0e0e0;
}

.footer .social-links {
    margin: 10px 0;
}

.footer .social-links a {
    margin: 0 10px;
    color: #e0e0e0;
    transition: color 0.3s ease;
}

.footer .social-links a:hover {
    color: #4CAF50;
}

/*=================================
  Back to Top Button
=================================*/
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background-color: #4CAF50;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    z-index: 1000;
    transition: background-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.8;
    display: flex;
    justify-content: center;
    align-items: center;
}

.back-to-top:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    opacity: 1;
}

.back-to-top-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

.back-to-top:hover .back-to-top-icon {
    transform: scale(1.1);
}

/*=================================
  Media Queries
=================================*/
@media (max-width: 768px) {

    .hero-content h1 {
        font-size: 36px;
    }

    .hero-content p {
        font-size: 18px;
    }

    .features h2,
    .platforms h2,
    .cta h2,
    .faq h2 {
        font-size: 28px;
    }

    .features-grid {
        gap: 20px;
    }

    .feature-card h3 {
        font-size: 20px;
    }

    .platform-icon p {
        font-size: 16px;
    }

    .cta p {
        font-size: 18px;
    }

    .footer p {
        font-size: 14px;
    }

    .footer .social-links a {
        font-size: 20px;
    }

    .back-to-top {
        right: 20px;
        bottom: 20px;
        width: 40px;
        height: 40px;
    }

    .back-to-top-icon {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {

    .features-grid,
    .platforms-icons {
        gap: 20px;
    }

    .hero-content h1 {
        font-size: 28px;
    }

    .hero-content p,
    .cta p {
        font-size: 16px;
    }

    .cta h2 {
        font-size: 28px;
    }

    .cta .cta-button {
        font-size: 16px;
        padding: 12px 30px;
    }

    .back-to-top {
        right: 15px;
        bottom: 15px;
        width: 35px;
        height: 35px;
    }

    .back-to-top-icon {
        width: 16px;
        height: 16px;
    }
}