/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ELIMINAR BARRAS AZULES - SCROLLBARS Y SELECCIÓN */
::-webkit-scrollbar {
    display: none;
}

html {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

::selection {
    background: rgba(255, 107, 53, 0.3);
    color: #ffffff;
}

::-moz-selection {
    background: rgba(255, 107, 53, 0.3);
    color: #ffffff;
}

/* Eliminar outline azul en elementos enfocados */
*:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.5) !important;
}

/* Eliminar highlight azul en elementos clickeables */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Permitir selección de texto solo donde sea necesario */
p, span, h1, h2, h3, h4, h5, h6 {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

:root {
    --primary-color: #ff6b35;
    --secondary-color: #e55a2b;
    --accent-color: #ffd700;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #ffffff;
    --text-secondary: #adb5bd;
    --background: #000000;
    --surface: #1a1a1a;
    --surface-light: #2c2c2c;
    --border: #404040;
    --shadow: rgba(255, 107, 53, 0.2);
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Language Toggle Button */
.language-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.language-btn {
    background: var(--gradient);
    border: none;
    border-radius: 50px;
    padding: 12px 16px;
    color: var(--background);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px var(--shadow);
    min-width: 70px;
    justify-content: center;
}

.language-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--shadow);
    background: var(--secondary-color);
}

/* Back Button */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.back-btn {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 50px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 100px;
    justify-content: center;
}

.back-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
    box-shadow: 0 8px 25px var(--shadow);
}

/* Background Shapes */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: var(--gradient);
    opacity: 0.05;
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -100px;
    animation-delay: 2s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: -75px;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Main Container */
.main-container {
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
    margin-top: 80px;
}

/* Section Titles */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--primary-color);
}

/* Profile Section */
.profile-section {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out;
}

.profile-image {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    position: relative;
    cursor: pointer;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
    border-radius: 50%;
}

.profile-image:hover img {
    transform: scale(1.05);
}

.agency-name {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.agency-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
}

/* Stats */
.stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filter Section */
.filter-section {
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 25px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--gradient);
    border-color: var(--primary-color);
    color: var(--background);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow);
}

/* Efecto de click en botones de filtro */
.filter-btn:active {
    transform: scale(0.95) !important;
}

/* Filter Results */
.filter-results {
    margin-top: 1rem;
}

.filter-count {
    display: inline-block;
    background: var(--primary-color);
    color: var(--background);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    animation: countUp 0.3s ease-out;
}

/* Certifications Section */
.certifications-section {
    margin-bottom: 3rem;
}

.certification-item {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.certification-item:nth-child(1) { animation-delay: 0.1s; }
.certification-item:nth-child(2) { animation-delay: 0.2s; }
.certification-item:nth-child(3) { animation-delay: 0.3s; }
.certification-item:nth-child(4) { animation-delay: 0.4s; }
.certification-item:nth-child(5) { animation-delay: 0.5s; }
.certification-item:nth-child(6) { animation-delay: 0.6s; }
.certification-item:nth-child(7) { animation-delay: 0.7s; }
.certification-item:nth-child(8) { animation-delay: 0.8s; }

.certification-item.hidden {
    opacity: 0 !important;
    transform: translateY(20px) scale(0.95) !important;
    pointer-events: none;
}

.certification-item.visible {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: auto;
}

.certification-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.certification-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 12px 40px var(--shadow);
}

.certification-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.certification-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.certification-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--background);
}

.certification-badge.tecnicas {
    background: var(--primary-color);
}

.certification-badge.calidad {
    background: var(--success-color);
}

.certification-badge.seguridad {
    background: var(--error-color);
}

.certification-badge.ambiental {
    background: var(--accent-color);
    color: var(--background);
}

.certification-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

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

.view-btn {
    background: var(--gradient);
    border: none;
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    color: var(--background);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px var(--shadow);
}

.certification-content {
    padding: 1.5rem;
}

.certification-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.certification-subtitle {
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.certification-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.certification-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
}

.certification-details {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.certification-details span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.certification-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.certification-status.valid {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.certification-status.expired {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.certification-status.pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

/* Mensaje de no resultados */
.no-results-message {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

/* Verification Section */
.verification-section {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.verification-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.verification-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.verification-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 180px;
    justify-content: center;
}

.verification-btn.whatsapp {
    background: #25D366;
    color: white;
}

.verification-btn.email {
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.verification-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow);
    text-decoration: none;
    color: inherit;
}

.verification-btn.email:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Contact Section */
.contact-section {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.contact-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.contact-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 180px;
    justify-content: center;
}

.contact-btn.whatsapp {
    background: #25D366;
    color: white;
}

.contact-btn.phone {
    background: var(--gradient);
    color: var(--background);
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow);
    text-decoration: none;
    color: inherit;
}

/* Social Section */
.social-section {
    text-align: center;
    animation: fadeInUp 0.8s ease-out 0.7s both;
}

.social-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
    border: 2px solid var(--border);
    background: var(--surface);
}

.social-link i {
    font-size: 1.25rem;
}

.social-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--shadow);
    text-decoration: none;
}

/* Social Media Colors */
.instagram { color: #e4405f; }
.instagram:hover { background: #e4405f; color: var(--background); border-color: #e4405f; }

.facebook { color: #1877f2; }
.facebook:hover { background: #1877f2; color: var(--background); border-color: #1877f2; }

.linkedin { color: #0077b5; }
.linkedin:hover { background: #0077b5; color: var(--background); border-color: #0077b5; }

.tiktok { color: var(--text-primary); }
.tiktok:hover { background: var(--text-primary); color: var(--background); border-color: var(--text-primary); }

.contact-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.contact-info i {
    color: var(--primary-color);
}

.contact-info a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.contact-info a:hover {
    color: var(--primary-color);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: var(--surface);
    margin: 2% auto;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideInUp 0.4s ease-out;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--text-primary);
    margin: 0;
    font-size: 1.5rem;
}

.close {
    color: var(--text-secondary);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.close:hover {
    color: var(--primary-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-image {
    margin-bottom: 1.5rem;
}

.modal-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 12px;
}

.modal-info h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.modal-info p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.detail-item {
    background: var(--surface-light);
    padding: 1rem;
    border-radius: 8px;
}

.detail-item strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.detail-item span {
    color: var(--text-secondary);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-badge.valid {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.modal-footer {
    padding: 1.5rem;
    border-top: 2px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    min-width: 160px;
    justify-content: center;
}

.modal-btn.verify-btn {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.modal-btn.verify-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.modal-btn.contact-btn {
    background: #25D366;
    color: white;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow);
}

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

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

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

@keyframes countUp {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Language Transition Animation */
.language-transition {
    opacity: 0.7;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.language-transition.complete {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 575.98px) {
    .main-container {
        padding: 1.5rem 0.5rem;
        margin-top: 70px;
    }
    
    .agency-name {
        font-size: 2rem;
    }
    
    .stats {
        gap: 1.5rem;
    }
    
    .filter-buttons {
        gap: 0.25rem;
    }
    
    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .certification-content {
        padding: 1.25rem;
    }
    
    .certification-image {
        height: 180px;
    }
    
    .verification-buttons,
    .contact-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .verification-btn,
    .contact-btn {
        min-width: 200px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-details {
        grid-template-columns: 1fr;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-btn {
        min-width: 100%;
    }
    
    .back-button,
    .language-toggle {
        top: 15px;
    }
    
    .back-button {
        left: 15px;
    }
    
    .language-toggle {
        right: 15px;
    }
}

@media (max-width: 479.98px) {
    .agency-name {
        font-size: 1.75rem;
    }
    
    .stats {
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .certification-details {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .certification-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* Tablet y Desktop */
@media (min-width: 768px) {
    .main-container {
        padding: 3rem 2rem;
        margin-top: 100px;
    }
    
    .agency-name {
        font-size: 3rem;
    }
    
    .stats {
        gap: 3rem;
    }
    
    .certification-image {
        height: 220px;
    }
}

@media (min-width: 992px) {
    .main-container {
        padding: 4rem 2rem;
    }
    
    .certification-image {
        height: 240px;
    }
}