/* ===================================
   Components (Buttons, Cards, Forms, Loaders)
   =================================== */

/* Buttons */
.btn,
.cta-button {
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    font-family: var(--font-primary);
    text-decoration: none;
    display: inline-block;
}

.cta-button {
    padding: 10px 24px;
    border-radius: 8px;
}

.btn-primary,
.cta-button {
    background: var(--primary-500);
    color: white;
}

.btn-primary:hover,
.cta-button:hover {
    transform: translateY(-2px);
    background: var(--primary-600);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
}


/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-base);
    margin-bottom: calc(var(--spacing-unit) * 4);
    backdrop-filter: blur(10px);
}

.back-link:hover {
    color: var(--primary-500);
    border-color: var(--primary-500);
    transform: translateX(-5px);
    box-shadow: var(--shadow-md);
    background: var(--bg-secondary);
}

.back-link svg {
    transition: transform var(--transition-base);
}

.back-link:hover svg {
    transform: translateX(-3px);
}

/* Stats */
.stat-item {
    padding: calc(var(--spacing-unit) * 3);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 2px solid var(--accent-500);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-base);
}

.stat-item:hover {
    background: var(--bg-secondary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-500);
    display: block;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Feature Cards */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: calc(var(--spacing-unit) * 3);
}

.feature-card {
    padding: calc(var(--spacing-unit) * 4);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: 2px solid var(--primary-500);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-base);
    cursor: pointer;
    max-width: 100%;
}

.feature-card:nth-child(even) {
    border-top-color: var(--accent-500);
}

.feature-card:hover {
    transform: translateY(-8px);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-500);
    border-radius: 16px;
    margin-bottom: calc(var(--spacing-unit) * 3);
    transition: all var(--transition-bounce);
}

.feature-card:hover .feature-icon {
    transform: rotateY(360deg) scale(1.1);
}

.feature-icon svg {
    width: 30px;
    height: 30px;
    color: white;
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}


/* Project Cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: calc(var(--spacing-unit) * 4);
}

.project-category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.project-category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.project-category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-500);
}

.project-category-card:hover::before {
    opacity: 1;
}

.project-category-card h3 {
    color: var(--primary-500);
    margin-bottom: 2rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-display);
    font-weight: 700;
}

.project-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    transition: all var(--transition-base);
    font-weight: 500;
}

.project-list li:hover {
    background: white;
    transform: translateX(5px) scale(1.02);
    box-shadow: var(--shadow-sm);
    color: var(--primary-500);
}

.project-list li svg {
    width: 20px;
    height: 20px;
    color: var(--accent-500);
    flex-shrink: 0;
}

/* Content Grids */
.about-content,
.contact-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: calc(var(--spacing-unit) * 8);
    align-items: center;
}

.about-text h2,
.contact-info h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.about-text>p,
.contact-info>p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: calc(var(--spacing-unit) * 4);
    line-height: 1.8;
}

.about-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
}

.about-list li {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.about-list svg,
.contact-item svg {
    width: 24px;
    height: 24px;
    color: var(--primary-500);
    flex-shrink: 0;
}

.about-visual {
    display: flex;
    justify-content: center;
}

.visual-card {
    width: 100%;
    max-width: 400px;
    padding: calc(var(--spacing-unit) * 5);
    background: var(--primary-500);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
}

.visual-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.visual-content {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 4);
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: calc(var(--spacing-unit) * 3);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.metric-value {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    color: white;
}

.metric-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

/* Testimonials */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: calc(var(--spacing-unit) * 3);
}

.testimonial-card {
    padding: calc(var(--spacing-unit) * 4);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-bottom: 2px solid var(--primary-500);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-base);
}

.testimonial-card:hover {
    transform: translateY(-8px);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
}

.testimonial-stars {
    color: #fbbf24;
    font-size: 1.2rem;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.testimonial-text {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: calc(var(--spacing-unit) * 3);
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
}

.author-name {
    font-weight: 600;
    color: var(--text-primary);
}

.author-title {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

/* Contact Form */
.contact-details {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
    color: var(--text-secondary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 3);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group input,
.form-group textarea {
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    background: var(--bg-primary);
    box-shadow: 0 0 0 2px rgba(0, 114, 188, 0.1);
}

.form-group textarea {
    resize: vertical;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            #ffffff 0%,
            #f8fbff 50%,
            #f9fcf9 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
    overflow: hidden;
}

.loading-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle,
            rgba(0, 114, 188, 0.1) 0%,
            transparent 50%);
    animation: rotateGradient 20s linear infinite;
}

.loading-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(0, 114, 188, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(141, 198, 63, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(0, 114, 188, 0.08) 0%, transparent 50%);
    animation: floatParticles 15s ease-in-out infinite;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    text-align: center;
    position: relative;
    z-index: 1;
}

.loading-brand {
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: calc(var(--spacing-unit) * 4);
    overflow: hidden;
    position: relative;
}

.loading-brand span {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px) rotateX(-90deg);
    animation: slideUpFade3D 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform-origin: bottom;
    margin: 0 0.1em;
}

.loading-brand span:nth-child(1) {
    animation-delay: 0.1s;
}

.loading-brand span:nth-child(2) {
    animation-delay: 0.25s;
}

.loading-brand span:nth-child(3) {
    animation-delay: 0.4s;
}

.spinner-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto calc(var(--spacing-unit) * 3);
}

.spinner {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(0, 114, 188, 0.1);
    border-top-color: var(--primary-500);
    border-right-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    box-shadow: 0 0 20px rgba(0, 114, 188, 0.2);
}

.spinner-inner {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border: 4px solid rgba(141, 198, 63, 0.1);
    border-top-color: var(--accent-500);
    border-left-color: var(--accent-500);
    border-radius: 50%;
    animation: spin 1.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) reverse infinite;
    box-shadow: 0 0 15px rgba(141, 198, 63, 0.2);
}

.spinner-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(0, 114, 188, 0.4);
}

.loader p {
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-size: 0.85rem;
    animation: pulse 2s infinite;
    position: relative;
}

.loader p::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes slideUpFade3D {
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

@keyframes rotateGradient {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes floatParticles {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

@keyframes dots {

    0%,
    20% {
        content: '';
    }

    40% {
        content: '.';
    }

    60% {
        content: '..';
    }

    80%,
    100% {
        content: '...';
    }
}

/* Team Section */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.team-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.team-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-500);
}

.team-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-500);
    margin-bottom: 1rem;
    background-color: var(--bg-secondary);
}

.team-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.team-role {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.linkedin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #0077b5;
    color: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}


.linkedin-btn:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 20px rgba(0, 119, 181, 0.3);
}

.linkedin-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
}


/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.gallery-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
    height: 220px;
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-500);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    transform: scale(1.05);
}

/* Carousel Styles */
.carousel-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    /* Fixed height works better than aspect-ratio for team photos */
    height: 480px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.carousel-container.mini {
    height: 200px;
    margin-top: 1rem;
}

/* The track-container and track fill the whole box */
.carousel-track-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-track {
    padding: 0;
    margin: 0;
    list-style: none;
    position: relative;  /* anchor for absolutely-positioned slides */
    width: 100%;
    height: 100%;
}

/* Every slide sits on top of the same spot; only .active is visible */
.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    pointer-events: none;
}

.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* Hover Description Styles */
.sub-service-card {
    position: relative;
    overflow: hidden;
}

.hover-desc {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    background: rgba(0, 114, 188, 0.9);
    color: white;
    font-size: 0.9rem;
    text-align: center;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    /* Smooth butter curve */
    z-index: 20;
    backdrop-filter: blur(4px);
}

.sub-service-card:hover .hover-desc {
    transform: translateY(0);
    opacity: 1;
}

/* Carousel Nav Styles */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.carousel-nav:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.carousel-nav.prev {
    left: 20px;
}

.carousel-nav.next {
    right: 20px;
}

.carousel-nav svg {
    width: 24px;
    height: 24px;
    color: var(--primary-500);
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: white;
    transform: scale(1.2);
}

.gallery-card:hover img {
    transform: scale(1.05);
}

/* WhatsApp Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    background-color: #128C7E;
    box-shadow: 2px 2px 10px #666;
}

.whatsapp-float svg {
    width: 35px;
    height: 35px;
    fill: currentColor;
}

/* Logo Marquee */
.logo-marquee {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 20px 0;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-content {
    display: flex;
    gap: 40px;
    width: max-content;
    animation: marquee 30s linear infinite;
}

.logo-marquee.reverse .marquee-content {
    animation: marquee-reverse 30s linear infinite;
    /* Starting position is handled by the animation keyframes 0% */
}

.logo-marquee-container {
    width: 100vw;
    margin-left: max(-50vw, calc((100% - 100vw) / 2));
    margin-right: max(-50vw, calc((100% - 100vw) / 2));
    overflow: hidden;
    position: relative;
    background: transparent;
}

.marquee-content:hover {
    animation-play-state: paused;
}

.marquee-content img {
    height: 60px;
    width: auto;
    object-fit: contain;
    filter: grayscale(0%) opacity(1);
    transition: all 0.3s ease;
}

.marquee-content img:hover {
    filter: brightness(1.1);
    transform: scale(1.1);
}

/* Responsive Overrides (Moved from layout.css to fix cascade) */
@media (max-width: 768px) {

    .features-grid,
    .testimonials-grid,
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
    }

    /* Slightly shorter carousel on phones — still tall enough to show photos */
    .carousel-container {
        height: 300px;
    }
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.gallery-card:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #fff;
    font-weight: 600;
}

.gallery-overlay p {
    margin: 0;
    font-size: 0.9rem;
    color: #eee;
    line-height: 1.4;
}