/**
 * Estilos del Módulo de Apps e Integraciones
 * Diseño moderno y minimalista estilo OpenAI
 */

/* ============================================== 
   CONTENEDOR PRINCIPAL
   ============================================== */

.apps-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================== 
   INTRODUCCIÓN
   ============================================== */

.apps-intro {
    background: linear-gradient(135deg, #f6f8fc 0%, #f0f4ff 100%);
    border-radius: 16px;
    padding: 24px 28px;
    border: 1px solid #e5e7eb;
}

.apps-intro-text {
    margin: 0;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
}

.apps-establecimiento-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    color: #1e40af;
    font-size: 14px;
    font-weight: 500;
}

.apps-establecimiento-info svg {
    color: #3b82f6;
}

/* ============================================== 
   SECCIONES
   ============================================== */

.apps-sections {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.apps-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.apps-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.apps-section-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.apps-section-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* ============================================== 
   GRID DE APPS
   ============================================== */

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* ============================================== 
   TARJETAS DE APP
   ============================================== */

.app-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

.app-card:hover::before {
    opacity: 1;
}

/* Estado: No disponible */
.app-card.no-disponible {
    opacity: 0.7;
    background: #fafafa;
}

.app-card.no-disponible .app-icon {
    opacity: 0.6;
}

/* Estado: Habilitada */
.app-card.habilitada {
    border-color: #10b981;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.app-card.habilitada::before {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    opacity: 1;
}

/* ============================================== 
   HEADER DE LA TARJETA
   ============================================== */

.app-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.app-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    color: white;
    transition: transform 0.3s ease;
}

.app-icon .app-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.app-card:hover .app-icon {
    transform: scale(1.05);
}

.app-status {
    display: flex;
    align-items: center;
}

.app-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.app-status-badge.disponible {
    background: #dbeafe;
    color: #1e40af;
}

.app-status-badge.habilitada {
    background: #d1fae5;
    color: #065f46;
}

.app-status-badge.no-disponible {
    background: #f3f4f6;
    color: #6b7280;
}

/* ============================================== 
   CONTENIDO DE LA TARJETA
   ============================================== */

.app-card-content {
    flex: 1;
    margin-bottom: 20px;
}

.app-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.app-description {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #6b7280;
}

/* ============================================== 
   FOOTER DE LA TARJETA
   ============================================== */

.app-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

/* ============================================== 
   SWITCH
   ============================================== */

.app-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    cursor: pointer;
}

.app-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.app-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 34px;
}

.app-switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.app-switch input:checked + .app-switch-slider {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.app-switch input:checked + .app-switch-slider:before {
    transform: translateX(22px);
}

.app-switch input:focus + .app-switch-slider {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* ============================================== 
   BOTONES
   ============================================== */

.app-btn-config,
.app-btn-notify {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.app-btn-config:hover,
.app-btn-notify:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.app-btn-config:active,
.app-btn-notify:active {
    transform: translateY(0);
}

.app-btn-config svg,
.app-btn-notify svg {
    flex-shrink: 0;
}

.app-btn-notify {
    border-color: #dbeafe;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
}

.app-btn-notify:hover {
    border-color: #bfdbfe;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

/* ============================================== 
   RESPONSIVE
   ============================================== */

@media (max-width: 768px) {
    .apps-container {
        padding: 16px;
        gap: 24px;
    }

    .apps-grid {
        grid-template-columns: 1fr;
    }

    .apps-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .app-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .app-btn-config,
    .app-btn-notify {
        width: 100%;
        justify-content: center;
    }

    .app-switch {
        align-self: flex-start;
    }
}

/* ============================================== 
   ANIMACIONES
   ============================================== */

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

.app-card {
    animation: slideInUp 0.4s ease-out backwards;
}

.app-card:nth-child(1) { animation-delay: 0.05s; }
.app-card:nth-child(2) { animation-delay: 0.1s; }
.app-card:nth-child(3) { animation-delay: 0.15s; }
.app-card:nth-child(4) { animation-delay: 0.2s; }

/* ============================================== 
   ESTADOS ESPECIALES
   ============================================== */

/* Efecto de brillo en tarjetas habilitadas */
.app-card.habilitada::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(16, 185, 129, 0.1),
        transparent
    );
    transition: left 0.5s ease;
}

.app-card.habilitada:hover::after {
    left: 100%;
}

