/* Custom styles for KnowHow Consulting */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #5CBB5C; /* Verde del logo */
    --success-color: #5CBB5C; /* Verde del logo */
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --custom-bg: #0F1B2B;
    --logo-green: #5CBB5C; /* Color principal del logo */
}

/* General Styles */
body {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: var(--custom-bg) !important;
}

/* Logo Green Theme */
.bg-logo-green {
    background-color: var(--logo-green) !important;
}

.text-logo-green {
    color: var(--logo-green) !important;
}

.border-logo-green {
    border-color: var(--logo-green) !important;
}

/* Navigation Styles */
.navbar {
    background-color: var(--custom-bg) !important;
}

.navbar-brand {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-knowhow {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600; /* SemiBold */
    color: #ffffff;
    font-size: 1.4rem;
}

.brand-consulting {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300; /* Light */
    color: #ffffff;
    font-size: 1.1rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
}

/* Dropdown Menu Styles */
.dropdown-menu {
    background-color: var(--custom-bg) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 0.375rem !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    min-width: 120px !important;
    z-index: 1000 !important;
    display: none !important;
}

.dropdown-menu.show {
    display: block !important;
}

.dropdown-item {
    color: #ffffff !important;
    padding: 0.5rem 1rem !important;
    transition: background-color 0.3s ease !important;
    text-decoration: none !important;
    display: block !important;
    width: 100% !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--primary-color) !important;
}

.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

/* Hover effect for dropdown */
.nav-item.dropdown:hover .dropdown-menu {
    display: block !important;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.125rem;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-background {
    background-image: linear-gradient(rgba(15, 27, 43, 0.7), rgba(15, 27, 43, 0.7)), url('../images/hero-background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Mobile hero background optimization */
@media (max-width: 768px) {
    .hero-background {
        background-attachment: scroll; /* Fixed attachment causes issues on mobile */
        background-position: center center;
        background-size: cover;
    }
}

@media (max-width: 576px) {
    .hero-background {
        background-position: center 30%; /* Better positioning for small screens */
    }
}

/* Consultant Header Background */
.consultant-header {
    background-image: linear-gradient(rgba(13, 110, 253, 0.3), rgba(13, 110, 253, 0.3)), url('../images/consultant-background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    padding: 60px 0;
}

/* Text shadow for better readability on background image */
.consultant-header h1,
.consultant-header p {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Consultant Header Breadcrumb Styling */
.consultant-header .breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
}

.consultant-header .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.consultant-header .breadcrumb-item a:hover {
    color: rgba(255, 255, 255, 1) !important;
}

.consultant-header .breadcrumb-item.active {
    color: rgba(255, 255, 255, 1) !important;
}

.consultant-header .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Card Hover Effects */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Button Styles */
.btn {
    font-weight: 500;
    padding: 0.625rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.125rem;
}

/* Icon Styles */
.fa-10x {
    font-size: 10em;
}

/* Form Styles */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Contact Info Styles */
.contact-info .fas {
    width: 20px;
    text-align: center;
}

/* Email and Long Text Breaking */
.email-text,
.contact-info p,
.footer .email-text {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    white-space: normal;
    line-height: 1.4;
}

/* Specific styling for email containers */
.email-container {
    max-width: 100%;
    overflow: hidden;
}

/* Responsive email handling */
@media (max-width: 768px) {
    .email-text {
        font-size: 0.9rem;
        word-break: break-all;
    }
    
    .contact-info .d-flex {
        flex-wrap: wrap;
    }
    
    .contact-info .fas {
        flex-shrink: 0;
    }
}

/* Accordion Styles */
.accordion-button:not(.collapsed) {
    background-color: rgba(13, 110, 253, 0.1);
    border-color: var(--primary-color);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Badge Styles */
.badge {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Footer Styles */
footer {
    background-color: var(--custom-bg) !important;
}

footer a:hover {
    color: var(--primary-color) !important;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.8s ease-in;
}

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

/* Responsive Design Adjustments */
@media (max-width: 768px) {
    .hero-section {
        min-height: 70vh;
        text-align: center;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .display-6 {
        font-size: 1.75rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    .btn-lg {
        padding: 0.625rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1.5rem !important;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* Service Cards Hover Effect */
.hover-shadow {
    transition: all 0.3s ease;
}

.hover-shadow:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Print Styles */
@media print {
    .navbar,
    footer,
    .btn,
    .badge {
        display: none !important;
    }
    
    .container {
        max-width: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles for Better Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--dark-color) !important;
    }
    
    .btn-outline-primary {
        border-width: 2px;
    }
}

/* Custom Background Sections */
.bg-light {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
}

.bg-light .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

.bg-light .card {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.bg-light .card-body {
    color: #ffffff !important;
}

/* Service Phase Accordion Styling */
.accordion-item {
    background-color: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.accordion-button {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
    border: none !important;
}

.accordion-button:not(.collapsed) {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.accordion-button:focus {
    border-color: var(--logo-green) !important;
    box-shadow: 0 0 0 0.25rem rgba(92, 187, 92, 0.25) !important;
}

.accordion-body {
    background-color: #ffffff !important;
    color: #212529 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.accordion-collapse.show .accordion-body {
    background-color: #ffffff !important;
    color: #212529 !important;
}

/* Ensure accordion body text is readable */
.accordion-body p,
.accordion-body ul,
.accordion-body li,
.accordion-body strong {
    color: #212529 !important;
}

/* Enhanced Mobile Optimization */
@media (max-width: 991.98px) {
    /* Navigation improvements for tablets */
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .brand-knowhow {
        font-size: 1.2rem;
    }
    
    .brand-consulting {
        font-size: 1rem;
    }
    
    /* Hero section tablet optimization */
    .hero-section .display-4 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
    }
    
    /* Service cards improvements */
    .card-body {
        padding: 2rem !important;
    }
    
    /* Better spacing for medium screens */
    .py-5 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
}

@media (max-width: 768px) {
    /* Navigation mobile optimization */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .brand-knowhow {
        font-size: 1.1rem;
    }
    
    .brand-consulting {
        font-size: 0.9rem;
    }
    
    /* Logo size adjustment for mobile */
    .navbar-brand img {
        height: 32px !important;
    }
    
    /* Improved navbar collapse for mobile */
    .navbar-collapse {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .navbar-nav .nav-item {
        margin-bottom: 0.5rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 0.375rem;
        text-align: center;
    }
    
    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link:focus {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    /* Hero section mobile optimization */
    .hero-section {
        min-height: 70vh;
        text-align: center;
        padding-top: 80px !important;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1.5rem !important;
    }
    
    .hero-section .lead {
        font-size: 1rem;
        margin-bottom: 2rem !important;
    }
    
    /* Button improvements for mobile */
    .hero-section .d-flex {
        flex-direction: column;
        gap: 1rem !important;
    }
    
    .btn-lg {
        padding: 0.75rem 2rem;
        font-size: 1rem;
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
    
    /* Typography improvements */
    .display-6 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .display-5 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    /* Card optimizations */
    .card-body {
        padding: 1.5rem !important;
    }
    
    .card-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    /* Icon size adjustments */
    .fa-3x {
        font-size: 2.5rem !important;
    }
    
    /* Contact info mobile styling */
    .email-text {
        font-size: 0.9rem;
        word-break: break-all;
    }
    
    .contact-info .d-flex {
        flex-wrap: wrap;
    }
    
    .contact-info .fas {
        flex-shrink: 0;
    }
    
    /* Form improvements for mobile */
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    .form-label {
        font-weight: 600;
        margin-bottom: 0.5rem;
    }
    
    /* Section spacing adjustments */
    .py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    /* Better list spacing */
    .list-unstyled li {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    /* Extra small screens optimization */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Navigation micro-optimizations */
    .navbar-brand {
        font-size: 1rem;
    }
    
    .brand-knowhow {
        font-size: 1rem;
    }
    
    .brand-consulting {
        font-size: 0.8rem;
    }
    
    .navbar-brand img {
        height: 28px !important;
    }
    
    /* Hero section for small phones */
    .hero-section {
        padding-top: 70px !important;
        min-height: 65vh;
    }
    
    .hero-section .display-4 {
        font-size: 1.75rem;
        margin-bottom: 1rem !important;
    }
    
    .hero-section .lead {
        font-size: 0.95rem;
        margin-bottom: 1.5rem !important;
    }
    
    /* Typography for small screens */
    .display-5 {
        font-size: 1.5rem;
    }
    
    .display-6 {
        font-size: 1.3rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    h5 {
        font-size: 1rem;
    }
    
    /* Card compact styling */
    .card-body {
        padding: 1.25rem !important;
    }
    
    .card-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .card-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    /* Icon adjustments for small screens */
    .fa-3x {
        font-size: 2rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Button optimizations */
    .btn {
        padding: 0.5rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 0.625rem 1.5rem;
        font-size: 0.95rem;
    }
    
    /* Section spacing for small screens */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    /* Accordion improvements for mobile */
    .accordion-button {
        padding: 1rem;
        font-size: 0.95rem;
    }
    
    .accordion-body {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    /* Service page improvements */
    .breadcrumb {
        font-size: 0.85rem;
        padding: 0.5rem 0;
    }
    
    /* Contact form mobile optimization */
    .row.g-3 > div {
        margin-bottom: 1rem;
    }
    
    /* Better mobile form styling */
    .form-control:focus {
        font-size: 16px; /* Prevents zoom on iOS */
        box-shadow: 0 0 0 0.2rem rgba(92, 187, 92, 0.25);
        border-color: var(--logo-green);
    }
    
    /* Improved mobile buttons */
    .btn-lg {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
        min-height: 48px; /* Better touch target */
    }
    
    /* Better mobile card spacing */
    .card {
        margin-bottom: 1.5rem;
    }
    
    /* Improved text readability */
    p, .card-text {
        line-height: 1.6;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Better touch targets */
    .btn {
        min-height: 48px; /* Improved from 44px for better accessibility */
        min-width: 48px;
        padding: 0.75rem 1.5rem;
    }
    
    .nav-link {
        padding: 0.875rem 1rem;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .dropdown-item {
        padding: 0.875rem 1rem !important;
        min-height: 48px !important;
    }
    
    /* Better touch targets for forms */
    .form-control,
    .form-select {
        min-height: 48px;
        padding: 0.75rem 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .form-check-input {
        min-width: 24px;
        min-height: 24px;
    }
    
    /* Remove hover effects on touch devices */
    .card:hover {
        transform: none !important;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
    }
    
    .btn:hover {
        transform: none !important;
    }
    
    /* Better link spacing for touch */
    .navbar-nav .nav-link {
        margin: 0.25rem 0;
    }
    
    /* Enhanced accordion touch targets */
    .accordion-button {
        min-height: 54px;
        padding: 1rem 1.25rem;
    }
}

/* Landscape phone optimization */
@media (max-width: 812px) and (orientation: landscape) {
    .hero-section {
        min-height: 60vh;
        padding-top: 60px !important;
    }
    
    .py-5 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
}

/* Image optimization for mobile */
@media (max-width: 768px) {
    /* Service page banner images */
    .service-banner {
        height: 300px !important; /* Reduced from default */
        background-attachment: scroll !important;
    }
    
    /* Logo optimizations */
    .navbar-brand img,
    .footer img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    /* Better image loading */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* Performance optimizations for slow connections */
@media (max-width: 576px) {
    /* Reduced animations for better performance */
    * {
        animation-duration: 0.2s !important;
        transition-duration: 0.2s !important;
    }
    
    /* Optimize background images for small screens */
    .service-banner {
        height: 250px !important;
        background-size: cover !important;
        background-position: center !important;
    }
}

/* Dark mode optimization for mobile */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
    .card {
        background-color: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .form-control {
        background-color: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        color: #ffffff !important;
    }
    
    .form-control::placeholder {
        color: rgba(255, 255, 255, 0.6) !important;
    }
}

/* Improved scroll behavior for mobile */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    body {
        overflow-x: hidden; /* Prevent horizontal scroll */
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .card,
    .btn,
    .nav-link {
        transition: none !important;
    }
    
    .fade-in {
        animation: none !important;
    }
    
    html {
        scroll-behavior: auto !important;
    }
}
