/* ============================================
   CICESE - Main Stylesheet
   ============================================ */

:root {
    --color-primary: #1e40af;
    --color-secondary: #059669;
    --color-primary-dark: #1e3a8a;
    --color-secondary-dark: #10b981;
}

/* Utility Classes */
.bg-primary { background-color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.hover\:bg-secondary:hover { background-color: var(--color-secondary); }

/* Hero Section */
.hero-bg {
    background-color: #1e3a8a; 
    background-image: linear-gradient(135deg, #1e3a8a 0%, #10b981 100%); 
}

.service-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #10b981 100%);
}

.project-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #10b981 100%);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.8s ease-out forwards;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.floating-btn {
    animation: float 3s ease-in-out infinite;
}

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

.loading-bar {
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, #1e40af, #059669);
    background-size: 200% 100%;
    animation: loading 2s infinite;
}

/* Cards */
.service-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.project-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e40af;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    margin-bottom: 5px;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Construction and Tree Symbols */
.construction-symbols {
    position: absolute;
    bottom: 20px;
    right: 20px;
    opacity: 0.2;
    z-index: 1;
}

.construction-icon {
    display: inline-block;
    margin: 0 10px;
    font-size: 2rem;
    color: white;
}

.tree-symbols {
    position: absolute;
    top: 20px;
    left: 20px;
    opacity: 0.2;
    z-index: 1;
}

.tree-icon {
    display: inline-block;
    margin: 0 8px;
    font-size: 1.8rem;
    color: white;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
}

.gallery-item img {
    transition: transform 0.3s ease;
}

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

/* Process Steps */
.process-step {
    position: relative;
    padding-left: 3rem;
}

.process-step::before {
    content: attr(data-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: #059669;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    background: linear-gradient(135deg, #1e3a8a 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Carousel */
.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 2rem 0;
}

.carousel-track {
    display: flex;
    gap: 1rem;
    animation: scroll 40s linear infinite;
    padding: 0 1rem;
}

.carousel-track:hover {
    animation-play-state: paused;
}

.carousel-item {
    flex: 0 0 300px;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.carousel-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-300px * 10 - 1rem * 10));
    }
}

/* Mobile Carousel */
.mobile-carousel {
    display: none;
    position: relative;
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 0;
}

.mobile-carousel-track {
    display: flex;
    gap: 1rem;
    padding: 0 1rem;
}

.mobile-carousel-item {
    flex: 0 0 85vw;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    scroll-snap-align: start;
    cursor: pointer;
}

.mobile-carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .carousel-container {
        display: none;
    }
    
    .mobile-carousel {
        display: block;
    }
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    touch-action: none;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 95%;
    max-height: 95%;
    position: relative;
    touch-action: pan-y pinch-zoom;
}

.lightbox-img {
    max-width: 100%;
    max-height: 95vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-select: none;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    z-index: 1001;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.image-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Mobile optimizations for lightbox */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 20px;
        right: 20px;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .construction-symbols,
    .tree-symbols {
        display: none;
    }
}

