* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #2c7a2c 0%, #4a9a4a 50%, #f4a623 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    z-index: 0;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.1) 2px, transparent 2px),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px, 30px 30px;
    animation: float 20s ease-in-out infinite;
}

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

.container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    text-align: center;
    max-width: 1083px;
    margin: 0 auto;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    max-width: 300px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.1));
}

.main-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 105px;
    max-width: 929px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 1s ease-out 0.3s both;
}

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

h1 {
    color: #2c7a2c;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    color: #4a9a4a;
    font-size: 1.2em;
    margin-bottom: 30px;
    font-weight: 300;
    letter-spacing: 1px;
}

.description {
    color: #555;
    font-size: 1.1em;
    line-height: 1.8;
    margin-bottom: 40px;
    text-align: left;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.feature {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid rgba(76, 154, 74, 0.1);
    transition: all 0.5s ease;
    opacity: 0;
    transform: translateY(30px);
    animation: featureSlideUp 0.8s ease-out forwards;
}

.feature:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(76, 154, 74, 0.3);
    border-color: rgba(76, 154, 74, 0.4);
}

.feature i {
    color: #4a9a4a;
    font-size: 2.5em;
    margin-bottom: 15px;
    display: block;
    transition: all 0.4s ease;
    animation: iconBounce 2s infinite;
}

.feature:hover i {
    color: #2c7a2c;
    transform: scale(1.2) rotate(10deg);
}

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

@keyframes iconBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

.feature h3 {
    color: #2c7a2c;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.feature p {
    color: #666;
    font-size: 0.9em;
    line-height: 1.6;
}

/* Estilo especial para la feature de Intranet */
.feature-intranet {
    background: linear-gradient(135deg, #ff6b35, #f7931e) !important;
    color: white !important;
    border: 2px solid rgba(255, 107, 53, 0.3) !important;
    box-shadow: 0 10px 25px rgba(255, 107, 53, 0.3) !important;
}

.feature-intranet:hover {
    transform: translateY(-10px) !important;
    box-shadow: 0 20px 40px rgba(255, 107, 53, 0.5) !important;
    border-color: rgba(255, 107, 53, 0.6) !important;
}

.feature-intranet i {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.feature-intranet:hover i {
    color: #fff !important;
    transform: scale(1.3) rotate(15deg) !important;
}

.feature-intranet h3 {
    color: white !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.feature-intranet p {
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.feature-intranet a {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* Navegación Principal */
.main-navigation {
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(20px);
    animation: navSlideIn 1s ease-out 0.5s forwards;
}

.nav-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-link {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    color: #2c7a2c;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.4s ease;
    border: 2px solid rgba(76, 154, 74, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(76, 154, 74, 0.3);
    border-color: rgba(76, 154, 74, 0.4);
    color: #1a5a1a;
}

.nav-link.active {
    background: linear-gradient(135deg, #4a9a4a, #2c7a2c);
    color: white;
    border-color: #2c7a2c;
    box-shadow: 0 6px 20px rgba(76, 154, 74, 0.4);
}

.nav-link.active:hover {
    background: linear-gradient(135deg, #2c7a2c, #1a5a1a);
    transform: translateY(-3px) scale(1.05);
}

.nav-link i {
    font-size: 1.1em;
    transition: transform 0.3s ease;
    color: #ff6b35;
}

.nav-link:hover i {
    transform: scale(1.2) rotate(5deg);
}

.nav-link.active i {
    animation: iconPulse 2s ease-in-out infinite;
}

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

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.status-badge {
    background: linear-gradient(135deg, #f4a623, #e09112);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(244, 166, 35, 0.3);
    animation: badgePulse 2s infinite, badgeSlideIn 1s ease-out;
    position: relative;
    overflow: hidden;
}

.status-badge::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: badgeShine 3s infinite;
}

.status-badge i {
    animation: gearSpin 2s linear infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 5px 15px rgba(244, 166, 35, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 8px 25px rgba(244, 166, 35, 0.5); }
}

@keyframes badgeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes badgeShine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@keyframes gearSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.contact-info {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
    border: 2px solid rgba(76, 154, 74, 0.1);
    opacity: 0;
    transform: translateY(30px);
    animation: contactSlideUp 1s ease-out 0.8s forwards;
}

.contact-info:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(76, 154, 74, 0.2);
}

.contact-info h3 {
    color: #2c7a2c;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.contact-info h3 i {
    animation: emailFloat 3s ease-in-out infinite;
    margin-right: 10px;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    color: #555;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.contact-item:hover {
    color: #2c7a2c;
    transform: translateX(10px);
}

.contact-item i {
    color: #4a9a4a;
    width: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.contact-item:hover i {
    color: #2c7a2c;
    transform: scale(1.2);
}

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

@keyframes emailFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.footer {
    margin-top: 50px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    animation: fadeIn 2s ease-out;
    line-height: 1.2;
}

.footer p {
    margin-bottom: 5px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.social-links {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
    opacity: 0;
    animation: socialFadeIn 1.5s ease-out 1.2s forwards;
}

.social-link {
    color: rgba(44, 122, 44, 0.8);
    font-size: 1.8em;
    transition: all 0.4s ease;
    text-decoration: none;
    padding: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: socialFloat 3s ease-in-out infinite;
}

.social-link:nth-child(1) { animation-delay: 0s; }
.social-link:nth-child(2) { animation-delay: 0.5s; }
.social-link:nth-child(3) { animation-delay: 1s; }
.social-link:nth-child(4) { animation-delay: 1.5s; }

.social-link:hover {
    color: #f4a623;
    transform: translateY(-5px) scale(1.2);
    background: rgba(244, 166, 35, 0.2);
    box-shadow: 0 10px 25px rgba(244, 166, 35, 0.3);
}

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

@keyframes socialFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-3px) rotate(5deg); }
    50% { transform: translateY(-6px) rotate(0deg); }
    75% { transform: translateY(-3px) rotate(-5deg); }
}

.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal personalizado para evitar conflictos con el contenedor */
.modal {
    z-index: 9999 !important;
}

.modal-backdrop {
    z-index: 9998 !important;
}

.modal-dialog {
    margin: 1rem auto;
    max-width: 500px;
}

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.modal-header {
    border-radius: 12px 12px 0 0;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 1.25rem;
    max-height: 65vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 12px 12px;
}

/* Espaciado mejorado para el formulario */
.modal .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.modal .form-control, .modal .form-select {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.modal .form-control:focus, .modal .form-select:focus {
    border-color: #4a9a4a;
    box-shadow: 0 0 0 0.2rem rgba(74, 154, 74, 0.25);
}

.modal .alert {
    border-radius: 8px;
    border: none;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.modal .btn {
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.modal .mb-3 {
    margin-bottom: 0.75rem !important;
}

.modal .row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.modal .row > * {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Select2 personalizado para el modal */
.select2-container--bootstrap-5 .select2-selection {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    min-height: calc(2.25rem + 2px);
}

.select2-container--bootstrap-5 .select2-selection--multiple {
    padding: 0.25rem 0.5rem;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    background-color: #4a9a4a;
    border-color: #4a9a4a;
    color: white;
    border-radius: 4px;
    font-size: 0.85rem;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
    color: rgba(255, 255, 255, 0.8);
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: white;
}

/* Estilos para checkboxes en Select2 */
.select2-results__option input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
    cursor: pointer;
}

.select2-results__option {
    padding: 8px 12px !important;
    cursor: pointer;
}

.select2-results__option:hover {
    background-color: #f8f9fa !important;
}

.select2-results__option[aria-selected="true"] {
    background-color: #e8f5e8 !important;
    color: #2c7a2c !important;
}

.select2-option-checkbox {
    display: flex;
    align-items: center;
    width: 100%;
}

.select2-option-checkbox input[type="checkbox"]:checked {
    accent-color: #4a9a4a;
}

@media (max-width: 768px) {
    .main-content {
        padding: 30px 25px;
        margin: 0 15px;
    }
    
    .logo-container {
        padding: 25px;
        margin-bottom: 25px;
    }
    
    .logo {
        max-width: 200px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .description {
        text-align: center;
    }
    
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .modal-body {
        padding: 1.5rem;
        max-height: 60vh;
    }
    
    /* Navegación responsive */
    .nav-container {
        gap: 10px;
    }
    
    .nav-link {
        padding: 10px 16px;
        font-size: 0.9em;
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-link i {
        font-size: 1.2em;
    }
}

/* Estilos para el Directorio de Empresas */
.companies-page .row {
    margin-top: 2rem;
}

/* Ajustar el contenedor para la página de empresas */
.companies-page.container {
    max-width: 1400px !important;
}

.company-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    animation: slideUp 0.6s ease forwards;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.company-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #4a9a4a;
}

.company-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1rem;
    gap: 0.8rem;
}

.company-logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.company-logo {
    width: 80px;
    height: 80px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.company-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.company-category-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.company-category-badge.hotel { background: #007bff; }
.company-category-badge.restaurante { background: #dc3545; }
.company-category-badge.agencia { background: #28a745; }
.company-category-badge.artesania { background: #fd7e14; }
.company-category-badge.transporte { background: #6f42c1; }
.company-category-badge.gastronomia { background: #20c997; }

.company-info h3 {
    color: #2c7a2c;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.company-info p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.company-contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #555;
    font-size: 0.9rem;
}

.contact-item i {
    color: #4a9a4a;
    width: 16px;
}

.company-services {
    margin-bottom: 1rem;
    flex-grow: 1;
}

.company-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.company-name {
    margin-bottom: 1rem;
    text-align: center;
}

.service-tag {
    display: inline-block;
    background: #f8f9fa;
    color: #495057;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    margin: 0.2rem;
    border: 1px solid #dee2e6;
}

.company-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stars {
    color: #ffc107;
}

.rating-number {
    font-weight: bold;
    color: #2c7a2c;
}

.company-actions {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 8px 12px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: #4a9a4a;
    color: white;
}

.btn-primary:hover {
    background: #2c7a2c;
    color: white;
}

.btn-outline {
    background: transparent;
    color: #4a9a4a;
    border: 1px solid #4a9a4a;
}

.btn-outline:hover {
    background: #4a9a4a;
    color: white;
}

/* Filtros de empresas */
.companies-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2rem 0;
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #2c7a2c;
    border-color: white;
}

/* Estadísticas */
.stats-container {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 15px;
    text-align: center;
    min-width: 120px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #2c7a2c;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* Responsive para empresas */
@media (max-width: 768px) {
    .companies-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .company-header {
        flex-direction: column;
        text-align: center;
    }
    
    .companies-filters {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .stats-container {
        gap: 0.5rem;
    }
    
    .stat-card {
        min-width: 100px;
        padding: 0.8rem;
    }
}
