/* ================================================
   OTHMAN ALSHAHRANI - PREMIUM ENHANCEMENTS CSS
   Advanced Styles & Animations
   ================================================ */

/* ==================== LENIS SMOOTH SCROLL ==================== */
html.lenis {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

/* ==================== THEME TOGGLE BUTTON (IN NAVBAR) ==================== */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--color-gold-primary);
}

.theme-toggle i {
    font-size: 1rem;
    color: var(--color-gold-primary);
    transition: transform 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(15deg);
}

/* ==================== LIGHT MODE ==================== */
body.light-mode {
    --color-bg-primary: #f5f5f5;
    --color-bg-secondary: #ffffff;
    --color-bg-tertiary: #e8e8e8;
    --color-text-primary: #1a1a1a;
    --color-text-secondary: #4a4a4a;
    --color-text-muted: #7a7a7a;
}

body.light-mode .navbar {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
}

body.light-mode .nav-link,
body.light-mode .nav-logo span {
    color: #1a1a1a;
}

body.light-mode .hero-overlay {
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(245, 245, 245, 0.7) 50%,
        rgba(245, 245, 245, 0.95) 100%
    );
}

body.light-mode .hero-title .char {
    color: #1a1a1a;
}

body.light-mode .hero-title .golden .char {
    color: var(--color-gold-primary);
}

body.light-mode .about,
body.light-mode .services,
body.light-mode .testimonials,
body.light-mode .contact {
    background: #ffffff;
}

body.light-mode .portfolio {
    background: #f5f5f5;
}

body.light-mode .section-title {
    color: #1a1a1a;
}

body.light-mode .section-subtitle {
    color: var(--color-gold-primary);
}

body.light-mode .about-text p {
    color: #4a4a4a;
}

body.light-mode .service-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .service-title {
    color: #1a1a1a;
}

body.light-mode .service-description {
    color: #4a4a4a;
}

body.light-mode .testimonial-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .testimonial-text {
    color: #4a4a4a;
}

body.light-mode .testimonial-author h4 {
    color: #1a1a1a;
}

body.light-mode .footer {
    background: #1a1a1a;
}

body.light-mode .filter-btn {
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.2);
}

body.light-mode .contact-form input,
body.light-mode .contact-form textarea,
body.light-mode .contact-form select {
    background: #ffffff;
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.2);
}

/* ==================== ENHANCED CURSOR ==================== */
.cursor-dot.hover {
    transform: translate(-50%, -50%) scale(2);
    background: var(--color-gold-primary);
}

.cursor-outline.hover {
    transform: translate(-50%, -50%) scale(1.5);
    border-color: var(--color-gold-primary);
    border-width: 1px;
}

/* ==================== VANILLA TILT GLARE ==================== */
.js-tilt-glare {
    border-radius: inherit;
}

/* ==================== GLIGHTBOX CUSTOMIZATION ==================== */
.glightbox-clean .gslide-description {
    background: rgba(10, 10, 10, 0.95);
}

.glightbox-clean .gslide-title {
    color: var(--color-gold-primary);
    font-family: 'Playfair Display', serif;
}

.glightbox-clean .gnext,
.glightbox-clean .gprev {
    background: var(--color-gold-primary);
    border: none;
}

.glightbox-clean .gclose {
    background: rgba(212, 175, 55, 0.2);
}

.glightbox-clean .gclose:hover {
    background: var(--color-gold-primary);
}

/* ==================== PARTICLES CONTAINER ==================== */
#particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ==================== MAGNETIC BUTTON ENHANCEMENT ==================== */
.magnetic {
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ==================== GSAP ANIMATION CLASSES ==================== */
.reveal-text {
    overflow: hidden;
}

.reveal-text span {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
}

.reveal-text.revealed span {
    transform: translateY(0);
    opacity: 1;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                opacity 0.8s ease;
}

/* ==================== SERVICE CARD TILT ENHANCEMENT ==================== */
.service-card {
    transform-style: preserve-3d;
}

.service-card .service-icon,
.service-card .service-title,
.service-card .service-description,
.service-card .service-features {
    transform: translateZ(30px);
}

/* ==================== PORTFOLIO ITEM HOVER ENHANCEMENT ==================== */
.portfolio-item {
    transform-style: preserve-3d;
}

.portfolio-item .portfolio-overlay {
    transform: translateZ(20px);
}

/* ==================== STATS COUNTER ANIMATION ==================== */
.stat-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.stat-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== FLOATING ANIMATION ==================== */
@keyframes floating {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.experience-badge {
    animation: floating 3s ease-in-out infinite;
}

/* ==================== GLOW PULSE ANIMATION ==================== */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(212, 175, 55, 0.6);
    }
}

.service-card:hover .service-glow {
    animation: glowPulse 2s ease-in-out infinite;
}

/* ==================== TEXT GRADIENT ANIMATION ==================== */
@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.hero-title .golden .char {
    background: linear-gradient(90deg, 
        var(--color-gold-primary), 
        var(--color-gold-secondary), 
        #ffffff,
        var(--color-gold-primary));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientFlow 4s ease infinite;
}

/* ==================== SCROLL REVEAL ANIMATIONS ==================== */
[data-aos="fade-up-premium"] {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    transition-property: opacity, transform;
}

[data-aos="fade-up-premium"].aos-animate {
    opacity: 1;
    transform: translateY(0) scale(1);
}

[data-aos="zoom-in-premium"] {
    opacity: 0;
    transform: scale(0.8);
    transition-property: opacity, transform;
}

[data-aos="zoom-in-premium"].aos-animate {
    opacity: 1;
    transform: scale(1);
}

/* ==================== BUTTON RIPPLE EFFECT ==================== */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* ==================== ENHANCED PRELOADER ==================== */
.preloader-logo {
    position: relative;
}

.preloader-logo::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--color-gold-primary), 
        transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        opacity: 0.3;
        transform: translateX(-50%) scaleX(0.5);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scaleX(1);
    }
    100% {
        opacity: 0.3;
        transform: translateX(-50%) scaleX(0.5);
    }
}

/* ==================== CONTACT FORM ENHANCEMENTS ==================== */
.form-group input:focus ~ label,
.form-group textarea:focus ~ label,
.form-group select:focus ~ label,
.form-group input:valid ~ label,
.form-group textarea:valid ~ label,
.form-group select:valid ~ label {
    transform: translateY(-25px) scale(0.8);
    color: var(--color-gold-primary);
}

.form-group .focus-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-gold-primary);
    transition: width 0.4s ease;
}

.form-group input:focus ~ .focus-border,
.form-group textarea:focus ~ .focus-border,
.form-group select:focus ~ .focus-border {
    width: 100%;
}

/* ==================== LOADING SKELETON ==================== */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==================== RESPONSIVE ADJUSTMENTS ==================== */
@media (max-width: 768px) {
    .theme-toggle {
        bottom: 80px;
        left: 20px;
        width: 45px;
        height: 45px;
    }
    
    .cursor-dot,
    .cursor-outline {
        display: none;
    }
}

/* ==================== RTL ADJUSTMENTS FOR LTR MODE ==================== */
html[dir="ltr"] .hero-cta .btn-primary i {
    transform: rotate(180deg);
}

html[dir="ltr"] .nav-menu {
    flex-direction: row;
}

html[dir="ltr"] .about-grid {
    direction: ltr;
}

html[dir="ltr"] .contact-grid {
    direction: ltr;
}

html[dir="ltr"] .footer-grid {
    direction: ltr;
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .preloader,
    .cursor-dot,
    .cursor-outline,
    .whatsapp-float,
    .back-to-top,
    .theme-toggle,
    #particles {
        display: none !important;
    }
}

/* ==================== SIGNATURE WATERMARK ==================== */
.signature-watermark {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    animation: signatureFadeIn 1s ease forwards;
    animation-delay: 2s;
}

.signature-watermark img {
    width: 70px;
    height: auto;
    /* Make signature white for dark background */
    filter: brightness(0) invert(1);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.signature-watermark:hover {
    pointer-events: auto;
}

.signature-watermark:hover img {
    opacity: 1;
    transform: scale(1.05);
}

/* Light mode signature - keep original dark color */
body.light-mode .signature-watermark img {
    filter: none;
    opacity: 0.5;
}

body.light-mode .signature-watermark:hover img {
    opacity: 0.8;
}

@keyframes signatureFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive signature */
@media (max-width: 768px) {
    .signature-watermark {
        bottom: 20px;
        right: 20px;
    }
    
    .signature-watermark img {
        width: 50px;
    }
}
