/* Custom styles to override default layout */

/* Add this new rule for the hero section */
#hero {
    overflow: hidden; /* Hide horizontal overflow caused by nowrap text */
}

/* Add this new rule for the hero heading */
#hero h1 {
    font-size: 6vw; /* Set font size relative to viewport width (adjust 6vw as needed) */
}



/* Custom Cursor for Service Cards */
.custom-cursor {
    position: fixed;
    width: 80px;
    height: 80px;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-cursor.active {
    opacity: 1;
}

.cursor-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.play-icon::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 8px solid #fff;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    margin-left: 2px;
}

.rotating-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: rotate 4s linear infinite;
}

.text-char {
    position: absolute;
    left: 50%;
    transform-origin: 0 40px;
    font-size: 10px;
    font-weight: 600;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Client Statistics Section Styles */
#clients .client-stat-number {
    line-height: 0.8 !important; /* Tighter line height for large numbers */
    letter-spacing: -0.03em !important; /* Better letter spacing */
    margin-bottom: 1rem !important; /* Override Tailwind mb-4 */
}

#clients .client-stat-line {
    position: relative !important;
    width: calc(100% + 8px) !important; /* Extend beyond the container */
    margin-left: -4px !important; /* Center the extended line */
    margin-right: -4px !important;
    margin-bottom: 1.5rem !important; /* More space after line */
    border-bottom: 4px solid white !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
}

#clients .client-stat-title {
    margin-top: 0 !important;
    line-height: 1.2 !important;
}

/* Enhanced responsive font sizing for client stats */
@media (max-width: 480px) {
    #clients .client-stat-number {
        font-size: 3rem !important; /* Much smaller on very small screens */
        line-height: 0.9 !important;
        margin-bottom: 0.75rem !important;
    }
    
    #clients .client-stat-line {
        margin-bottom: 1rem !important;
        width: calc(100% + 6px) !important;
        margin-left: -3px !important;
        margin-right: -3px !important;
    }
    
    #clients .client-stat-title {
        font-size: 1rem !important; /* Smaller title text */
        line-height: 1.3 !important;
    }
}

@media (min-width: 481px) and (max-width: 640px) {
    #clients .client-stat-number {
        font-size: 4rem !important; /* sm equivalent but more controlled */
        line-height: 0.85 !important;
        margin-bottom: 0.875rem !important;
    }
    
    #clients .client-stat-line {
        margin-bottom: 1.25rem !important;
        width: calc(100% + 8px) !important;
    }
    
    #clients .client-stat-title {
        font-size: 1.25rem !important; /* xl equivalent */
        line-height: 1.3 !important;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    #clients .client-stat-number {
        font-size: 5rem !important; /* Between sm and md */
        line-height: 0.8 !important;
        margin-bottom: 1rem !important;
    }
    
    #clients .client-stat-line {
        margin-bottom: 1.5rem !important;
        width: calc(100% + 10px) !important;
        margin-left: -5px !important;
        margin-right: -5px !important;
    }
    
    #clients .client-stat-title {
        font-size: 1.5rem !important; /* 2xl equivalent */
        line-height: 1.25 !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    #clients .client-stat-number {
        font-size: 6rem !important; /* md equivalent but controlled */
        line-height: 0.8 !important;
        margin-bottom: 1.25rem !important;
    }
    
    #clients .client-stat-line {
        margin-bottom: 1.75rem !important;
        width: calc(100% + 12px) !important;
        margin-left: -6px !important;
        margin-right: -6px !important;
    }
    
    #clients .client-stat-title {
        font-size: 1.875rem !important; /* 3xl equivalent */
        line-height: 1.2 !important;
    }
}

@media (min-width: 1025px) {
    #clients .client-stat-number {
        font-size: 8rem !important; /* lg equivalent but controlled */
        line-height: 0.75 !important;
        margin-bottom: 1.5rem !important;
    }
    
    #clients .client-stat-line {
        margin-bottom: 2rem !important;
        width: calc(100% + 16px) !important;
        margin-left: -8px !important;
        margin-right: -8px !important;
    }
    
    #clients .client-stat-title {
        font-size: 2.25rem !important; /* 4xl equivalent */
        line-height: 1.1 !important;
    }
}

/* About section styles - two column layout */
#about .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem 2rem;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

#about .grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.about-content {
    padding-right: 2rem;
}

#about-title, #sectors-title {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

/* Slide-up text reveal animation styles */
.slide-up-container {
    overflow: hidden;
    position: relative;
    display: block;
    /* Add a subtle line-height adjustment to prevent text clipping */
    line-height: 1.1;
}

.slide-up-text {
    transform: translateY(100%);
    transition: transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
    display: block;
    will-change: transform;
    /* Ensure smooth rendering */
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Word-level staggered animation styles */
.word-container,
.title-word-container,
.subtitle-word-container {
    display: inline-block;
    position: relative;
    vertical-align: top;
}

.word-text,
.title-word-text,
.subtitle-word-text {
    display: inline-block;
    transform: translate(0px, 100px);
    transition: transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
    backface-visibility: hidden;
    vertical-align: top;
}

.in-view .title-word-text {
    transform: translate(0px, 0px) !important;
}

.in-view .subtitle-word-text {
    transform: translate(0px, 0px) !important;
}

/* Animation trigger classes with staggered timing */
#about.in-view .slide-up-text.animate-title {
    transform: translateY(0);
    transition-delay: 0.2s;
}

#about.in-view .slide-up-text.animate-subtitle {
    transform: translateY(0);
    transition-delay: 0.5s;
}

/* Services section animation trigger classes with staggered timing */
#services.in-view .slide-up-text.animate-title {
    transform: translateY(0);
    transition-delay: 0.2s;
}

#services.in-view .slide-up-text.animate-subtitle {
    transform: translateY(0);
    transition-delay: 0.5s;
}

/* Sectors section animation trigger classes with staggered timing */
#sectors.in-view .slide-up-text.animate-title {
    transform: translateY(0);
    transition-delay: 0.2s;
}

#sectors.in-view .slide-up-text.animate-subtitle {
    transform: translateY(0);
    transition-delay: 0.5s;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .slide-up-container {
        line-height: 1.2;
    }

    .slide-up-text {
        transition-duration: 0.7s;
    }

    #about.in-view .slide-up-text.animate-title {
        transition-delay: 0.1s;
    }

    #about.in-view .slide-up-text.animate-subtitle {
        transition-delay: 0.3s;
    }

    /* Services section mobile responsive adjustments */
    #services.in-view .slide-up-text.animate-title {
        transition-delay: 0.1s;
    }

    #services.in-view .slide-up-text.animate-subtitle {
        transition-delay: 0.3s;
    }
    
    /* Sector popup mobile responsive adjustments */
    .sector-popup {
        width: 100%;
        max-height: 85vh;
    }
    
    .sector-popup-header {
        padding: 1rem 1.5rem;
    }
    
    .sector-popup-title {
        font-size: 1.5rem;
    }
    
    .sector-popup-content {
        padding: 1rem;
    }
    
    .sector-popup-text {
        font-size: 1rem;
        line-height: 1.6;
    }
}

/* Base paragraph styles */
#about p {
    max-width: 90%;
}

/* Saudi flag styles - right column */
.saudi-flag-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 66.67%;
    perspective: 1000px;
    transform-style: preserve-3d;
    margin: 0 auto;
}

.saudi-flag {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../back_vid/sa.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s ease, opacity 0.8s ease;
    transform-style: preserve-3d;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    /* Initial state - hidden */
    opacity: 0;
}

/* Animation state when flag should be revealed */
.saudi-flag.fade-in {
    opacity: 1;
}

/* Responsive styles */
@media (max-width: 768px) {
    #about .container {
        min-height: auto;
        padding: 4rem 2rem;
    }

    #about .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .about-content {
        padding-right: 0;
        order: 1; /* Ensure text comes first */
        text-align: center !important; /* Override Tailwind's text-left */
    }

    #about-title {
        text-align: center;
    }

    #about p {
        text-align: center;
        margin: 0 auto;
    }

    .saudi-flag-container {
        max-width: 350px;
        margin: 1rem auto 0;
        order: 2; /* Ensure flag comes second */
    }

    .saudi-flag {
        box-shadow: none; /* Remove card appearance */
    }
}

@media (max-width: 480px) {
    #about .container {
        min-height: auto;
        padding: 3rem 1rem;
    }

    #about .grid {
        gap: 1.5rem;
    }

    .about-content {
        margin-bottom: 1rem;
        text-align: center !important;
    }

    #about-title {
        text-align: center;
        font-size: 2.5rem !important; /* Override large Tailwind size */
    }

    .saudi-flag-container {
        max-width: 280px;
        margin: 0.5rem auto 0;
    }

    .saudi-flag {
        box-shadow: none; /* Remove card appearance */
    }

    #about p {
        max-width: 100%;
        font-size: 0.9rem;
        line-height: 1.6;
    }
}

@media (max-width: 320px) {
    #about .container {
        padding: 2rem 0.5rem;
    }

    .about-content {
        text-align: center !important;
    }

    #about-title {
        font-size: 1.8rem !important;
        margin-bottom: 15px;
        text-align: center;
    }

    .saudi-flag-container {
        max-width: 250px;
        padding-bottom: 60%;
    }

    .saudi-flag {
        box-shadow: none; /* Remove card appearance */
    }

    #about p {
        font-size: 0.85rem;
        line-height: 1.5;
        text-align: center;
        margin: 0 auto;
    }

    #about-title {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
}

/* Loading Screen Styles */
#language-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

#language-loading-screen.active {
    opacity: 1;
    visibility: visible;
}

#language-loading-screen.slide-up {
    transform: translateY(-100%);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.loading-logo {
    max-width: 200px; /* Adjust as needed */
    animation: pulse-glow 2s ease-in-out infinite;
    filter: brightness(0) invert(1);
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
        transform: scale(1.02);
    }
}

/* Responsive loading text */
@media (max-width: 768px) {
    .loading-text {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .loading-text {
        font-size: 2.5rem;
        letter-spacing: 0.05em;
    }
}

/* Ensure loading screen appears above everything */
#language-loading-screen {
    z-index: 99999;
}

/* New Service Card Styles */
.service-card-new {
    position: relative;
    cursor: pointer; /* Changed to pointer for video click functionality */
    border-top: 1px solid #e5e7eb; /* light grey */
    border-bottom: 1px solid #e5e7eb; /* light grey */
    transition: border-color 0.3s ease;
    overflow: hidden; /* Prevent content from spilling out during animation */
}

.service-card-new:hover {
    border-top-color: #000;
    border-bottom-color: #000;
}

.service-card-inner {
    position: relative;
    padding: 2rem;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); /* Smoother transform */
}

.service-card-front {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.service-number {
    font-size: 1.875rem; /* 3xl */
    font-weight: 300; /* light */
    color: #4b5563; /* gray-600 */
}

.service-title {
    font-size: 1.5rem; /* 2xl */
    font-weight: 700; /* bold */
}

.service-card-back {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), margin-top 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-description {
    color: #6b7280; /* gray-500 */
    padding-top: 1rem;
    transform: translateY(20px);
    opacity: 0;
    /* This defines the EXIT animation */
    transition: transform 0.3s ease-out, opacity 0.2s ease-out;
}

.service-card-new:hover .service-card-back {
    max-height: 200px; /* Adjust as needed */
    margin-top: 1rem;
}

.service-card-new:hover .service-description {
    transform: translateY(0);
    opacity: 1;
    /* This defines the ENTER animation, synced with the card */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
                opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

/* New Sectors Section Styles */
#sectors-list {
    padding: 0 2rem; /* Add padding to the left and right */
}

.sector-item {
    padding: 1.5rem 0;
    border-top: 1px solid #e5e7eb; /* light grey */
    border-bottom: 1px solid #e5e7eb; /* light grey */
    cursor: pointer;
    transition: border-color 0.3s ease, padding 0.3s ease; /* Added padding to transition */
}

.sector-item:hover {
    border-bottom-color: #000;
    padding: 1.5rem 0; /* Explicitly keep padding the same */
}

.sector-title {
    font-size: 1.25rem; /* xl */
    font-weight: 600; /* semibold */
    color: #000;
    transition: color 0.3s ease;
    min-height: 2rem; /* Ensure consistent title height */
    display: flex;
    align-items: center;
}

.sector-subtext {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.7s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                margin-top 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0;
}

.sector-item.active .sector-subtext {
    opacity: 1;
    margin-top: 1rem;
}

/* Read More Link Styles */
.sector-read-more-link {
    display: inline-block;
    margin-left: 0.5rem;
    color: #000;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.sector-item.active .sector-read-more-link {
    opacity: 1;
    visibility: visible;
}

.sector-read-more-link:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #000;
    transition: width 0.3s ease;
}

.sector-read-more-link:hover {
    color: #000;
}

.sector-read-more-link:hover:after {
    width: 100%;
}

.sector-read-more-link:focus {
    outline: none;
    text-decoration: underline;
}

/* Sector Popup Styles */
.sector-popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1rem;
}

.sector-popup-container.active {
    opacity: 1;
    visibility: visible;
}

.sector-popup {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    position: relative;
    border-top: 4px solid #000;
}

.sector-popup-container.active .sector-popup {
    transform: scale(1);
}

.sector-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #fff;
}

.sector-popup-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: #000;
    position: relative;
    padding-bottom: 0.25rem;
}

.sector-popup-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.3s ease;
}

.sector-popup-close:hover {
    color: #000;
}

.sector-popup-content {
    padding: 1.5rem;
    background-color: #f9f9f9;
}

.sector-popup-text {
    margin: 0;
    line-height: 1.8;
    color: #4b5563;
    font-size: 1.05rem;
    text-align: justify;
}

#sector-image-container {
    position: relative;
    width: 100%;
    /* height: 400px; */ /* Adjust as needed */
    padding: 0 2rem; /* Add padding to the left and right */
}

.sector-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.sector-image.active {
    opacity: 1;
    transform: scale(1);
}


/* End of file */
/* Loading Logo Styles */
.loading-logo {
    max-width: 200px; /* Adjust as needed */
    animation: pulse-glow 2s ease-in-out infinite;
    filter: brightness(0) invert(1);
}

/* Responsive Navbar Logo */
.navbar-logo {
    height: 2.5rem; /* 40px */
    transition: height 0.3s ease-in-out;
}

@media (min-width: 768px) {
    .navbar-logo {
        height: 4rem; /* 64px */
    }
}

.footer-logo {
    filter: brightness(0) invert(1);
}

.logo-white {
    filter: brightness(0) invert(1);
}

#rotating-text-container {
    transition: opacity 0.5s ease-in-out;
    display: inline-block;
}

/* Footer Contact Button Styles */
.btn-footer-contact {
    border: 2px solid white;
    background-color: transparent;
    color: white;
    position: relative;
    overflow: hidden;
    transition: color 0.4s ease-in-out;
    z-index: 1;
}

.btn-footer-contact .relative.z-10 {
    color: inherit;
}

.btn-footer-contact::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    background-color: white;
    transition: height 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: -1;
}

.btn-footer-contact:hover {
    color: black;
}

.btn-footer-contact:hover::before {
    height: 100%;
}

/* Contact Form Styles */
.preload #contact-form-panel {
    transition: none !important;
}

/* Fix for RTL dropdown menu position */
html[dir="rtl"] .group .absolute {
    right: auto;
    left: 0;
}

#contact-form-overlay.hidden {
    display: none;
}

/* Contact form success and error states */
#form-success-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

#form-success-message h3 {
    margin-bottom: 1rem;
}

#form-status {
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

#form-status.text-red-600 {
    background-color: rgba(254, 226, 226, 0.5);
}

#form-status.text-green-600 {
    background-color: rgba(209, 250, 229, 0.5);
    color: black;
}

