/* Medical Category Grid Styles */
.medical-category-grid-wrapper {
    border-radius: 16px;
    margin: 30px 0;
    position: relative;
    overflow: hidden;
}

.medical-category-grid-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.medical-category-grid-wrapper .section-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.medical-category-grid-wrapper .section-title::after {
    content: '';
    position: absolute;
    background: linear-gradient(90deg, #4A90E2, #357ABD);
    border-radius: 2px;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
}

.medical-category-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.category-item {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.category-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.1), transparent);
    transition: left 0.6s ease;
}

.category-item:hover::before {
    left: 100%;
}

.category-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(74, 144, 226, 0.2);
    border-color: #4A90E2;
}

.category-link {
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    z-index: 2;
}

.category-icon {
    font-size: 48px;
    margin-bottom: 16px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    filter: grayscale(0.2);
}

.category-item:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
    filter: grayscale(0);
}

.category-name {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
    display: block;
    transition: all 0.3s ease;
    text-transform: capitalize;
}

.category-item:hover .category-name {
    color: #4A90E2;
    transform: translateY(-2px);
}

/* Loading animation */
.medical-category-grid.loading .category-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

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

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

/* Pulse effect for icons */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.category-item:hover .category-icon {
    animation: pulse 2s infinite;
}

/* Tablet Styles */
@media (max-width: 1024px) {
    .medical-category-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }
    
    .medical-category-grid-wrapper {
        padding: 35px 18px;
    }
    
    .category-item {
        padding: 20px 14px;
    }
    
    .category-icon {
        font-size: 42px;
        height: 60px;
        margin-bottom: 14px;
    }
    
    .category-name {
        font-size: 13px;
    }
    
    .medical-category-grid-wrapper .section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .medical-category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .medical-category-grid-wrapper {
        padding: 30px 15px;
        margin: 20px 0;
        border-radius: 12px;
    }
    
    .category-item {
        padding: 16px 12px;
        border-radius: 12px;
    }
    
    .category-item:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    .category-icon {
        font-size: 36px;
        height: 50px;
        margin-bottom: 12px;
    }
    
    .category-name {
        font-size: 12px;
        font-weight: 500;
    }
    
    .medical-category-grid-wrapper .section-title {
        font-size: 22px;
        margin-bottom: 25px;
    }
}

/* Extra small mobile */
@media (max-width: 480px) {
    .medical-category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .medical-category-grid-wrapper {
        padding: 25px 12px;
    }
    
    .category-item {
        padding: 14px 10px;
    }
    
    .category-icon {
        font-size: 32px;
        height: 45px;
        margin-bottom: 10px;
    }
    
    .category-name {
        font-size: 11px;
    }
    
    .medical-category-grid-wrapper .section-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .medical-category-grid-wrapper {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    .category-item {
        background: #3a4a5c;
        border-color: #4a5a6c;
    }
    
    .category-item:hover {
        border-color: #5dade2;
        box-shadow: 0 12px 40px rgba(93, 173, 226, 0.3);
    }
    
    .category-name {
        color: #ecf0f1;
    }
    
    .category-item:hover .category-name {
        color: #5dade2;
    }
    
    .medical-category-grid-wrapper .section-title {
        color: #ecf0f1;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .category-item {
        border: 2px solid #000;
    }
    
    .category-item:hover {
        border-color: #0066cc;
        background: #f0f8ff;
    }
    
    .category-name {
        color: #000;
        font-weight: 700;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .category-item,
    .category-icon,
    .category-name {
        transition: none;
    }
    
    .category-item:hover {
        transform: none;
    }
    
    .category-item::before {
        display: none;
    }
    
    .category-icon {
        animation: none !important;
    }
}
