/* Custom Fonts */
@font-face {
    font-family: 'MyFont';
    src: url('fonts/myfont.otf') format('opentype');
}

* {
    margin: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* for mobile touch hover */
}

body {
    font-family: 'MyFont';
    height: 100vh;
    position: relative;
    background-color: var(--body-background);
    display: flex;
    flex-direction: column;
}

.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url('images/background.webp');
    background-size: 100% 100vh;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: -1;
}

.top-bar {
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.top-bar.scrolled {
    background: rgba(0, 0, 0, 0.01);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.logo img {
    height: 32px;
    padding-left: 33px;
}

.tiktok-light {
    display: block;
}

.tiktok-dark {
   display: none;
}

a {
    color: #67b8ff;
    text-decoration: none;
    font-weight: 500;
  }
  a:hover {
    color: #98d3ff;
  }

/* Reset and base styles */
:root {
    --body-background: #0C0C0C;
    --text-color: #ffffff;
    --container-background: rgba(255, 255, 255, 0.03);
    --main-buttons-background: rgba(255, 255, 255, 0.02);
    --feature-buttons-background: rgba(255, 255, 255, 0.06);
    --dropdown-menu-background: rgba(0, 0, 0, 0.4);
    --popup-container-background: #181818;
}

@media (prefers-color-scheme: light) {
    :root {
        --body-background: #F3F3F3;
        --text-color: #000000;
        --container-background: rgba(255, 255, 255, 0.6);
        --main-buttons-background: rgba(255, 255, 255, 1);
        --feature-buttons-background: rgba(255, 255, 255, 1);
        --dropdown-menu-background: rgba(255, 255, 255, 0.4);
        --popup-container-background: #eeeeee;
    }
    
    .background-image {
        filter: invert(100%);
    }

    .logo {
        filter: invert(100%);
    }
    
    .more-icon {
        filter: invert(51%);
    }

    .chat-icon {
        filter: invert(100%);
    }

    .tiktok-light {
        display: none;
    }
    
    .tiktok-dark {
       display: block;
    }

    a {
        color: #003b6f;
        text-decoration: none;
        font-weight: 500;
      }
      a:hover {
        color: #005da4;
      }
}

/* Dropdown navigation */
.dropdown-nav {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.dropdown-toggle:hover {
    opacity: 0.8;
}

.dropdown-toggle:active {
    opacity: 0.6;
    transform: scale(0.95);
    transition: all 0.1s ease;
}

.chat-icon {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--dropdown-menu-background);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 16px;
    padding: 1rem;
    margin-right: 1rem;
    margin-top: -1rem;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-nav:hover .dropdown-menu,
.dropdown-nav:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-link {
    display: block;
    color: var(--text-color);
    text-decoration: none;
    padding: 0.7rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 10;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.nav-link:active {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(3px);
    transition: all 0.1s ease;
}

.main-content {
    padding: 0 0.6rem;
}

.content-container {
    background: var(--container-background);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 35px;
    padding: 1.6rem 1.1rem 1.6rem 1.1rem;
    max-width: 900px;
    width: 100%;
    margin: 0 auto 2rem;
}

.main-title {
    font-family: 'MyFont';
    font-size: 1.3rem;
    font-weight: 10;
    padding-bottom: 1.4rem;
    color: var(--text-color);
    letter-spacing: 0.2px;
    padding-left: 0.5rem;
}

/* Make Arabic text smaller */
.main-title::after {
    content: "سوشايل";
    font-size: 1.1rem;
    font-weight: 10;
    padding-bottom: 1.4rem;
    padding-left: 0.5rem;
    color: var(--text-color);
}

.button-grid {
    display: flex;
    gap: 0.55rem;
    width: 100%;
    justify-content: center;
}

/* Second container without background */
.content-container-no-bg {
    max-width: 900px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.button-grid-horizontal {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

/* Staggered slide-up with blur for horizontal buttons */
@keyframes slideUpBlur {
    from {
        opacity: 0;
        transform: translateY(26px);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0px);
    }
}

/* Reverse animation for hiding buttons */
@keyframes slideDownBlur {
    from {
        opacity: 1;
        transform: scale(1);
        filter: blur(0px);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
        filter: blur(8px);
    }
}

.button-grid-horizontal .feature-button-horizontal {
    opacity: 0;
    transform: translateY(26px);
    filter: blur(10px);
    animation: slideUpBlur 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.button-grid-horizontal .feature-button-horizontal:nth-child(1) { animation-delay: 0.00s; }
.button-grid-horizontal .feature-button-horizontal:nth-child(2) { animation-delay: 0.10s; }
.button-grid-horizontal .feature-button-horizontal:nth-child(3) { animation-delay: 0.20s; }
.button-grid-horizontal .feature-button-horizontal:nth-child(4) { animation-delay: 0.30s; }
.button-grid-horizontal .feature-button-horizontal:nth-child(5) { animation-delay: 0.40s; }
.button-grid-horizontal .feature-button-horizontal:nth-child(6) { animation-delay: 0.50s; }
.button-grid-horizontal .feature-button-horizontal:nth-child(7) { animation-delay: 0.60s; }
.button-grid-horizontal .feature-button-horizontal:nth-child(8) { animation-delay: 0.70s; }
.button-grid-horizontal .feature-button-horizontal:nth-child(9) { animation-delay: 0.80s; }
.button-grid-horizontal .feature-button-horizontal:nth-child(10) { animation-delay: 0.90s; }

/* Feature buttons */
.feature-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--main-buttons-background);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.02);
    box-shadow: 0 0px 35px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

/* Make button1 only slightly wider */
.feature-button:first-child {
    flex: 1.75;
}

.feature-button:not(:first-child) {
    flex: 1;
}

.feature-button:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.feature-button:active {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    transition: all 0.1s ease;
}

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

.button-image img {
    width: 100%;
    height: 105px;
    object-fit: contain;
    transition: transform 0.3s ease, height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Decrease image height when more button is active */
body.more-active .button-image img {
    height: 85px;
}

/* Glow backgrounds behind specific icons */
.button-image {
    position: relative;
}

/* Ensure the icon stays above the glow */
.button-image img {
    position: relative;
    z-index: 1;
}

/* Base for glow pseudo element */
#youtubeButton .button-image::before,
#tiktokButton .button-image::before,
#instagramButton .button-image::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    opacity: 0; /* start hidden for fade-in */
    will-change: opacity;
}

/* Red rectangular glow for YouTube */
#youtubeButton .button-image::before {
    width: 50px;
    height: 25px;
    border-radius: 18px;
    background: rgba(255, 127, 127, 0.3);
    box-shadow: 0 0 20px 8px rgba(255, 127, 127, 0.1);
    filter: blur(12px);
    /* offset a bit towards top-left */
    transform: translate(calc(-55% - 15px), calc(-55% - 15px));
    animation: glowFadeIn 4s ease-out forwards;
}

/* Blue circular glow for TikTok */
#tiktokButton .button-image::before {
    width: 10px;
    height: 40px;
    border-radius: 50%;
    background: rgba(52, 208, 255, 0.3);
    box-shadow: 0 0 20px 8px rgba(61, 213, 255, 0.3);
    filter: blur(9px);
    /* shift slightly to the right */
    transform: translate(calc(-50% + 10px), -60%);
    animation: glowFadeIn 5s ease-out forwards;
}

/* Yellow square glow for Instagram */
#instagramButton .button-image::before {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(247, 209, 105, 0.2);
    box-shadow: 0 0 20px 8px rgba(247, 210, 106, 0.1);
    filter: blur(9px);
    /* shift slightly to the right */
    transform: translate(calc(-50% + 10px), -70%);
    animation: glowFadeIn 5s ease-out forwards;
}

@keyframes glowFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#youtubeButton .button-image {
    padding: 19%;
}

.button-text {
    position: relative;
    z-index: 1;
}

/* Horizontal feature buttons */
.feature-button-horizontal {
    display: flex;
    align-items: center;
    height: 65px;
    background: var(--feature-buttons-background);
    border-radius: 40px;
    padding: 0rem 0.8rem;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.02);
    box-shadow: 0 0px 35px rgba(0, 0, 0, 0.02);
    transition: all 0.6s ease;
    overflow: hidden; /* for the hover radius */
}

.feature-button-horizontal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-button-horizontal:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.feature-button-horizontal:active {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    transition: all 0.1s ease;
}

.feature-button-horizontal:hover::before {
    opacity: 1;
}

.button-image-small {
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.button-image-small img {
    width: 100%;
    transition: transform 0.3s ease;
}

.feature-button-horizontal:hover .button-image-small img {
    transform: none;
}

.feature-button-horizontal .button-text {
    display: flex;
    align-items: center;
}

.feature-button-horizontal .button-text h3 {
    font-family: 'MyFont';
    font-size: 1.1rem;
    padding: 0 0.75rem;
    font-weight: 10;
    color: var(--text-color);
    line-height: 1;
}

/* Toggle button functionality */
#toggleButton {
    cursor: pointer;
    font-family: inherit;
}

.more-icon {
    transition: transform 0.3s ease;
}

.toggle-button.active .more-icon {
    transform: rotate(180deg);
}

@keyframes scaleInLeft {
    from {
        transform: scaleX(0.7) scaleY(0.7);
        filter: blur(8px);
        transform-origin: left center;
    }
    to {
        opacity: 1;
        transform: scaleX(1) scaleY(1);
        filter: blur(0px);
        transform-origin: left center;
    }
}

.feature-button {
    opacity: 0;
    animation: scaleInLeft 0.7s cubic-bezier(0.4,0,0.2,1) forwards;
}

.feature-button:nth-child(2) {
    opacity: 0;
    animation-delay: 0.2s;
}

.feature-button:nth-child(3) {
    opacity: 0;
    animation-delay: 0.5s;
}

/* Focus styles for accessibility */
.feature-button:focus,
.nav-link:focus,
.dropdown-toggle:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Smooth animation for hiddenContainer */
#hiddenContainer {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4,0,0.2,1), opacity 0.4s cubic-bezier(0.4,0,0.2,1);
    will-change: max-height, opacity;
}
#hiddenContainer.visible {
    opacity: 1;
    overflow: visible;
    max-height: 1000px; /* Allow container to expand to its natural height */
}

/* Animation classes for hidden buttons */
#hiddenContainer .feature-button-horizontal {
    opacity: 0;
    transform: translateY(26px);
    filter: blur(10px);
    animation: none;
}

#hiddenContainer.visible .feature-button-horizontal {
    animation: slideUpBlur 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#hiddenContainer.hiding .feature-button-horizontal {
    animation: slideDownBlur 0.3s ease-out forwards;
}

/* Staggered animation delays for hidden buttons */
#hiddenContainer.visible .feature-button-horizontal:nth-child(1) { animation-delay: 0.00s; }
#hiddenContainer.visible .feature-button-horizontal:nth-child(2) { animation-delay: 0.10s; }
#hiddenContainer.visible .feature-button-horizontal:nth-child(3) { animation-delay: 0.20s; }
#hiddenContainer.visible .feature-button-horizontal:nth-child(4) { animation-delay: 0.30s; }
#hiddenContainer.visible .feature-button-horizontal:nth-child(5) { animation-delay: 0.40s; }
#hiddenContainer.visible .feature-button-horizontal:nth-child(6) { animation-delay: 0.50s; }
#hiddenContainer.visible .feature-button-horizontal:nth-child(7) { animation-delay: 0.60s; }
#hiddenContainer.visible .feature-button-horizontal:nth-child(8) { animation-delay: 0.70s; }
#hiddenContainer.visible .feature-button-horizontal:nth-child(9) { animation-delay: 0.80s; }
#hiddenContainer.visible .feature-button-horizontal:nth-child(10) { animation-delay: 0.90s; }

/* Simple delays for hiding animation - all hide at once */
#hiddenContainer.hiding .feature-button-horizontal:nth-child(1) { animation-delay: 0.00s; }
#hiddenContainer.hiding .feature-button-horizontal:nth-child(2) { animation-delay: 0.00s; }
#hiddenContainer.hiding .feature-button-horizontal:nth-child(3) { animation-delay: 0.00s; }
#hiddenContainer.hiding .feature-button-horizontal:nth-child(4) { animation-delay: 0.00s; }
#hiddenContainer.hiding .feature-button-horizontal:nth-child(5) { animation-delay: 0.00s; }
#hiddenContainer.hiding .feature-button-horizontal:nth-child(6) { animation-delay: 0.00s; }
#hiddenContainer.hiding .feature-button-horizontal:nth-child(7) { animation-delay: 0.00s; }
#hiddenContainer.hiding .feature-button-horizontal:nth-child(8) { animation-delay: 0.00s; }
#hiddenContainer.hiding .feature-button-horizontal:nth-child(9) { animation-delay: 0.00s; }
#hiddenContainer.hiding .feature-button-horizontal:nth-child(10) { animation-delay: 0.00s; }

/* Remove background when active and make elements smaller with smooth animations */
#moreButton.active {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    height: 35px !important;
}

#moreButton.active .button-image-small {
    width: 35px;
    opacity: 80%;
}

#moreButton.active .button-text h3 {
    font-size: 0.95rem;
}

/* Remove hover effects when button is active */
#moreButton.active:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

#moreButton.active:hover::before {
    opacity: 0 !important;
}

/* Add smooth transitions for all changes */
#moreButton {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

#moreButton .button-image-small {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#moreButton .button-text h3 {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#moreButton .more-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Icon rotation for moreButton */
#moreButton.active .more-icon,
.more-icon.rotated {
    transform: rotate(180deg);
} 

/* Restore height for .feature-button in first container */
.content-container .feature-button {
    height: 180px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Decrease height when more button is active */
body.more-active .content-container .feature-button {
    height: 130px;
}

/* Generic Popup Styles */
.popup {
  display: flex;
  position: fixed;
  z-index: 2000;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup.active {
  opacity: 1;
  visibility: visible;
}

.popup-content {
  background: var(--popup-container-background);
  color: var(--text-color);
  border-radius: 18px;
  padding: 2rem;
  max-width: 90vw;
  width: 400px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  text-align: left;
  position: relative;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  filter: blur(5px);
  transition: opacity 0.4s ease, transform 0.4s ease, filter 0.4s ease;
}

.popup.active .popup-content {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0px);
}

#popupContent {
  font-family: system-ui, Arial, sans-serif !important;
}

.close-popup-btn {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: none;
  color: var(--text-color);
  border: none;
  font-size: 2rem;
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
}
.close-popup-btn:hover {
  opacity: 1;
}

/* Bottom Popup Section */
.bottom-popup-section {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 1rem 1rem;
    margin-top: auto;
    gap: 0.5rem;
}

/* Popup Button */
.popup-btn {
  background: rgba(255,255,255,0);
  color: var(--text-color);
  border: none;
  border-radius: 10px;
  font-family: sans-serif;
  font-size: 12px;
  padding: 0.5rem;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
  text-decoration: none;
  display: inline-block;
}
.popup-btn:hover { opacity: 1; background: rgba(190,190,190,0.2); }