/**
 * CSS para Categorias Dinâmicas Mobile
 * 
 * Estilos específicos para categorias baseadas em preferências
 * com carrosséis individuais
 * 
 * @author Sistema AgendQui
 * @version 1.0
 */

/* Container principal das categorias */
#categories-container {
    padding: 0;
    margin: 0;
}

/* Seção de categoria */
.category-section {
    margin-bottom: 2rem;
    position: relative;
}

/* Header da categoria */
.category-header {
    margin-bottom: 1rem;
    padding: 0 1rem;
}

.category-header .flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-header .flex .flex {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-icon {
    background-color: #dbeafe;
    padding: 0.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
}

.category-icon i {
    color: #2563eb;
    font-size: 1.125rem;
}

.category-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.2;
}

.category-header p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.3;
}

.see-all-btn {
    color: #2563eb;
    font-size: 0.875rem;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.see-all-btn:hover {
    color: #1d4ed8;
}

.see-all-btn i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.see-all-btn:hover i {
    transform: translateX(2px);
}

/* Container do carrossel */
.category-carousel-container {
    position: relative;
    overflow: hidden;
    padding: 0 1rem;
}

/* Wrapper do carrossel */
.category-carousel-wrapper {
    display: flex;
    gap: 1rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Cards do carrossel */
.category-carousel-card {
    flex: 0 0 320px;
    min-width: 320px;
    max-width: 320px;
}

/* Botões de navegação */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.carousel-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-50%) scale(1.05);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.category-carousel-prev {
    left: -6px;
}

.category-carousel-next {
    right: -6px;
}

.carousel-btn i {
    color: #374151;
    font-size: 0.875rem;
}

/* Informações adicionais nos cards */
.distance-info {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #059669;
    font-weight: 500;
}

.distance-info i {
    font-size: 0.625rem;
}

/* Estado vazio */
.no-establishments {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.no-establishments i {
    color: #9ca3af;
    font-size: 1.875rem;
    margin-bottom: 0.75rem;
}

/* Fallback message */
.fallback-message {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    margin: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.fallback-message i {
    color: #eab308;
    font-size: 1.875rem;
    margin-bottom: 0.75rem;
}

.fallback-message h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.fallback-message p {
    color: #6b7280;
    margin-bottom: 1rem;
}

.fallback-message button {
    background: #2563eb;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.fallback-message button:hover {
    background: #1d4ed8;
}

/* Categoria Disponível Hoje - Estilos específicos */
.category-disponivel-hoje {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-left: 4px solid #155724;
}

.category-disponivel-hoje .category-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.category-disponivel-hoje .category-title {
    color: #ffffff;
    font-weight: 600;
}

.category-disponivel-hoje .category-subtitle {
    color: rgba(255, 255, 255, 0.9);
}

.category-disponivel-hoje .category-icon {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    animation: pulse-gentle 2s infinite;
}

/* Status de funcionamento */
.establishment-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 4px;
}

.establishment-status.open {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.establishment-status.open::before {
    content: "●";
    color: #28a745;
    animation: pulse-dot 1.5s infinite;
}

.establishment-status.opens-today {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.establishment-status.opens-today::before {
    content: "○";
    color: #ffc107;
}

.establishment-status.opens-tomorrow,
.establishment-status.opens-later {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e9ecef;
}

.establishment-status.opens-tomorrow::before,
.establishment-status.opens-later::before {
    content: "○";
    color: #6c757d;
}

/* Badges dos estabelecimentos */
.establishment-badges {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.establishment-badge {
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.establishment-badge.popular {
    background: #ff6b6b;
    color: white;
}

.establishment-badge.excellent {
    background: #51cf66;
    color: white;
}

.establishment-badge.new {
    background: #339af0;
    color: white;
}

.establishment-badge.available {
    background: #51cf66;
    color: white;
    animation: pulse-gentle 2s infinite;
}

/* Animações */
@keyframes pulse-gentle {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes pulse-dot {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Hover effects para dispositivos com cursor */
@media (hover: hover) {
    .category-disponivel-hoje:hover {
        background: linear-gradient(135deg, #218838 0%, #1eb980 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    }
    
    .category-disponivel-hoje .establishment-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .category-section {
        margin-bottom: 1.5rem;
    }
    
    .category-header {
        padding: 0 0.5rem;
    }
    
    .category-carousel-container {
        padding: 0 0.5rem;
    }
    
    .category-carousel-card {
        flex: 0 0 280px;
        min-width: 280px;
        max-width: 280px;
    }
    
    .category-carousel-wrapper {
        gap: 0.75rem;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
    }
    
    .category-carousel-prev {
        left: -4px;
    }
    
    .category-carousel-next {
        right: -4px;
    }
    
    .category-icon {
        min-width: 40px;
        min-height: 40px;
        padding: 0.5rem;
    }
    
    .category-icon i {
        font-size: 1rem;
    }
    
    .category-header h2 {
        font-size: 1.125rem;
    }
    
    .see-all-btn {
        font-size: 0.8125rem;
    }

    .establishment-status {
        font-size: 10px;
        padding: 1px 6px;
    }
    
    .establishment-badge {
        font-size: 9px;
        padding: 1px 4px;
    }
    
    .category-disponivel-hoje .category-icon {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .category-carousel-card {
        flex: 0 0 260px;
        min-width: 260px;
        max-width: 260px;
    }
    
    .category-header .flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .see-all-btn {
        align-self: flex-end;
    }
}

/* Tablet landscape */
@media (min-width: 768px) and (max-width: 1024px) {
    .category-carousel-card {
        flex: 0 0 300px;
        min-width: 300px;
        max-width: 300px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .category-carousel-container {
        padding: 0 2rem;
    }
    
    .category-header {
        padding: 0 2rem;
    }
    
    .category-carousel-card {
        flex: 0 0 320px;
        min-width: 320px;
        max-width: 320px;
    }
    
    .category-carousel-wrapper {
        gap: 1.25rem;
    }
    
    .carousel-btn {
        width: 48px;
        height: 48px;
    }
    
    .category-carousel-prev {
        left: 8px;
    }
    
    .category-carousel-next {
        right: 8px;
    }
}

/* Animações */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-section {
    animation: fadeInUp 0.6s ease-out;
}

/* Smooth scrolling para carrosséis */
.category-carousel-wrapper {
    scroll-behavior: smooth;
}

/* Melhorias de acessibilidade */
.carousel-btn:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.see-all-btn:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* Estados de loading */
.category-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.category-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Otimizações de performance */
.category-carousel-wrapper {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.category-carousel-card {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Estilos para temas escuros (futuro) */
@media (prefers-color-scheme: dark) {
    .category-header h2 {
        color: #f9fafb;
    }
    
    .category-header p {
        color: #d1d5db;
    }
    
    .carousel-btn {
        background: #374151;
        border-color: #4b5563;
    }
    
    .carousel-btn:hover {
        background: #4b5563;
        border-color: #6b7280;
    }
    
    .carousel-btn i {
        color: #f9fafb;
    }
    
    .fallback-message {
        background: #374151;
    }
    
    .fallback-message h3 {
        color: #f9fafb;
    }
    
    .fallback-message p {
        color: #d1d5db;
    }
  }
}

/* Estados de loading */
.category-disponivel-hoje.loading {
    opacity: 0.7;
    pointer-events: none;
}

.category-disponivel-hoje.loading .category-icon {
    animation: spin 1s linear infinite;
}

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

/* Indicador de tempo real */
.real-time-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #28a745;
    margin-left: 8px;
}

.real-time-indicator::before {
    content: "●";
    color: #28a745;
    animation: pulse-dot 1s infinite;
}

/* Tooltip para mais informações */
.establishment-info-tooltip {
    position: relative;
    cursor: help;
}

.establishment-info-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.establishment-info-tooltip:hover::after {
    opacity: 1;
} 