/* Main Styles for DET Consultores MVP */

:root {
    --primary-color: #007bff;
    /* Adjust based on DET logo if needed */
    --secondary-color: #6c757d;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --font-main: 'Poppins', sans-serif;
    --font-main: 'Poppins', sans-serif;
}

body {
    font-family: var(--font-main);
    color: var(--dark-color);
    line-height: 1.6;
    font-weight: 400;
    /* Regular for body */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    /* Bold for headings */
}

/* Navbar */
.navbar {
    transition: all 0.3s ease;
}

.navbar-brand img {
    height: 55px;
    /* Adjust according to logo aspect ratio */
}

/* Hero Section */
.hero-section {
    padding: 100px 0 60px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 80vh;
}

.hero-text h1 {
    font-size: 2.5rem;
}

@media (min-width: 992px) {
    .hero-text h1 {
        font-size: 3.5rem;
    }
}

/* Services Flip Cards */
.flip-card {
    background-color: transparent;
    perspective: 1000px;
    /* Gives a 3D effect */
    min-height: 280px;
    /* Crucial: Prevents layout collapse from absolute children */
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

/* Desktop Hover and Mobile active classes */
.flip-card:hover .flip-card-inner,
.flip-card.is-flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    /* Safari */
    backface-visibility: hidden;
    border-radius: 0.25rem;
    /* Match bootstrap card radius */
}

/* Front is initially visible */
.flip-card-front {
    background-color: #fff;
    color: var(--dark-color);
}

/* Back is initially hidden by rotating it 180deg */
.flip-card-back {
    transform: rotateY(180deg);
    /* Aesthetics handled by Bootstrap utility classes but ensure content flows */
}

/* Override existing service card hover to avoid conflict with flip */
.service-card {
    transition: box-shadow 0.3s ease;
}

.flip-card:hover .flip-card-front,
.flip-card:hover .flip-card-back {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.icon-box i {
    color: var(--primary-color);
}

/* Portfolio */
.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 30px;
}

.portfolio-item img {
    transition: transform 0.5s ease;
}

.portfolio-item:hover img {
    transform: scale(1.1);
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 123, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

/* Chatbot Widget */
.chatbot-widget {
    position: fixed;
    bottom: 100px;
    /* Higher up to not overlap with robot initially, or strictly controlled via JS */
    right: 20px;
    width: 320px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    overflow: hidden;
    transition: all 0.3s ease;
    display: none;
    /* Hidden by default per req */
    opacity: 0;
}

.chatbot-widget.active {
    display: block;
    opacity: 1;
    animation: fadeIn 0.5s;
}

/* Robot Trigger */
.robot-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 80px;
    height: 80px;
    cursor: pointer;
    z-index: 1001;
    /* Above everything */
    animation: bobbing 2s infinite ease-in-out;
    transition: transform 0.3s ease;
}

.robot-trigger:hover {
    transform: scale(1.1);
}

.robot-trigger img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

@keyframes bobbing {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-header {
    background: var(--primary-color);
    color: white;
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.chatbot-body {
    height: 350px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
}

.message {
    margin-bottom: 10px;
    max-width: 85%;
    padding: 10px;
    border-radius: 10px;
    font-size: 0.9rem;
}

.message.bot {
    background: #e9ecef;
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

.message.user {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 0;
}

.quick-replies {
    margin-top: 5px;
}

/* Clients/Brand Section */
/* Clients/Brand Section */
.brand-item {
    padding: 0 20px;
    /* Espaciado lateral para "aire" */
    outline: none;
    /* Remove slick focus outline */
}

.brand-item img {
    max-height: 90px;
    /* Aumento significativo de tamaño (antes 50px) */
    width: auto;
    object-fit: contain;
    /* Evita deformación */
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
    margin: 0 auto;
    display: block;
    /* Fixes some spacing issues */
}

.brand-item:hover img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
    /* Slight zoom on hover for effect */
}

/* Team Section */
.team-img-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 50%;
    border: 5px solid #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.team-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.team-card:hover .team-img {
    transform: scale(1.15);
}

.team-card {
    transition: transform 0.3s ease;
}

.team-card:hover {
    transform: translateY(-5px);
}

/* Blog Section */
.blog-card {
    transition: box-shadow 0.3s ease;
}

.blog-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

.blog-img-wrapper {
    position: relative;
    overflow: hidden;
}

.blog-img-wrapper img {
    transition: transform 0.5s ease;
    height: 200px;
    width: 100%;
    object-fit: cover;
}

.blog-card:hover .blog-img-wrapper img {
    transform: scale(1.1);
}

.blog-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 5px 10px;
    font-size: 0.75rem;
    text-transform: none;
    border-radius: 4px;
}

/* Enforce Sentence Case / Normal Text */
h1,
h2,
h3,
h4,
h5,
h6,
.nav-link,
.btn,
.badge {
    text-transform: none !important;
}

/* Floating Buttons */
.back-to-top {
    position: fixed;
    bottom: 20px;
    left: 20px !important;
    /* Forced Left */
    right: auto !important;
    /* Clear Right */
    width: 45px;
    height: 45px;
    background: var(--dark-color);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 45px;
    font-size: 20px;
    z-index: 999;
    display: none;
    /* Hidden by default */
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.back-to-top:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.whatsapp-float {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background: #25d366;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 60px;
    font-size: 30px;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background: #128c7e;
    color: white;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .chatbot-widget {
        width: 280px;
        right: 15px;
        bottom: 80px;
        /* Adjusted for mobile */
    }

    .robot-trigger {
        width: 60px;
        height: 60px;
        right: 15px;
        bottom: 15px;
    }

    .back-to-top {
        bottom: 15px;
        /* Aligned with bottom */
        left: 15px;
        /* Moved to LEFT */
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 18px;
    }

    .whatsapp-float {
        width: 50px;
        height: 50px;
        line-height: 50px;
        font-size: 24px;
        left: 15px;
        bottom: 15px;
    }
}

/* Metrics Section (Bento Box Style) */
.metric-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Very subtle border */
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

/* Colored Sidebar Pseudo-element */
.metric-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    /* Thickness of the colored bar */
}

.card-teal::before {
    background-color: #00453e;
}

.card-pink::before {
    background-color: #e8c9eb;
}

.card-blue::before {
    background-color: #9bc4e2;
}

.card-yellow::before {
    background-color: #f3d060;
}

.metric-content h3 {
    font-size: 3.5rem;
    /* Massive numbers */
    color: #111;
    letter-spacing: -1px;
}

@media (max-width: 768px) {
    .metric-content h3 {
        font-size: 2.5rem;
    }
}

/* Portfolio Styles */
.portfolio-card {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15) !important;
}

.portfolio-img-container {
    height: 220px;
    background-color: #f8f9fa;
}

.portfolio-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 51, 102, 0.85);
    /* Dark blue overlay */
    opacity: 0;
    transition: all 0.3s ease;
}

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

/* Full Screen Loader */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-out;
}

.loader-content {
    position: relative;
    text-align: center;
}

.loader-logo {
    width: 120px;
    height: auto;
    animation: pulse 2s infinite ease-in-out;
    background: white;
    padding: 15px;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.loader-spinner {
    margin-top: 20px;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid white;
    animation: spin 1s linear infinite;
    margin: 20px auto 0;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

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

.overflow-hidden {
    overflow: hidden !important;
}

/* Contact Form Success */
.success-icon {
    width: 80px;
    height: 80px;
    background-color: #e6fcf5;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.success-icon i {
    color: #20c997;
    font-size: 40px;
}

#form-success {
    animation: fadeIn 0.5s ease-in-out;
}

/* Animated Service Icons */
.service-icon-video {
    width: 60px;
    height: 60px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

/* Footer Hover Effect */
.footer-link-hover {
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-link-hover:hover {
    color: #ffffff !important;
    padding-left: 5px;
}

/* Footer Social Links */
.footer-social-links .social-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    transition: color 0.3s ease, transform 0.3s ease;
    color: rgba(255, 255, 255, 0.5);
    /* Matches text-white-50 */
    text-decoration: none;
}

.footer-social-links .social-icon-link:hover {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

/* Main Footer (Strict Redesign) */
#main-footer {
    background-color: #0a0e1a;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    position: relative;
    z-index: 1;
    /* Below floaters */
    padding: 60px 0 30px;
}

#main-footer .footer-logo {
    max-height: 50px;
    filter: brightness(0) invert(1);
    /* Ensure white logo */
    margin-bottom: 20px;
}

#main-footer h5 {
    font-weight: 600;
    margin-bottom: 20px;
    color: #fff;
    font-size: 1.1rem;
}

#main-footer ul {
    list-style: none;
    padding: 0;
}

#main-footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    margin-bottom: 10px;
}

#main-footer a:hover {
    color: #ffffff;
    padding-left: 5px;
}

#main-footer .btn-cta {
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 50px;
    padding: 10px 25px;
    display: inline-block;
    margin-top: 15px;
    font-weight: 600;
    text-transform: none;
    /* Sentence case */
}

#main-footer .btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
    padding-left: 25px;
    /* Override standard link hover reset implies moving whole button or just text? let's keep it simple */
    color: white !important;
}

#main-footer .copyright-bar {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 40px;
    padding-top: 20px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Portfolio Image Aspect Ratio & Error Handling */
.portfolio-img-container {
    background-color: #f8f9fa;
    /* Light grey placeholder */
    position: relative;
    overflow: hidden;
    /* Force square aspect ratio if image fails or for container consistancy */
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensure image covers the square area */
    transition: transform 0.5s ease;
}

/* Fallback for broken images (using alt text styling if JS fails, but we rely on simple CSS bg here) */
.portfolio-img-container img:not([src]) {
    visibility: hidden;
}