/**
 * Skeleton Loading Animations
 * Premium loading states for a native app feel
 */

/* Base skeleton styles */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-dark {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Skeleton pulse alternative */
.skeleton-pulse {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ================================
   RESTAURANT CARD SKELETON
   ================================ */
.skeleton-wrapper {
    display: contents;
}

.restaurant-card-skeleton {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    min-height: 280px;
}

.restaurant-card-skeleton .skeleton-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.restaurant-card-skeleton .skeleton-body {
    padding: 16px;
}

.restaurant-card-skeleton .skeleton-title {
    height: 20px;
    width: 70%;
    margin-bottom: 12px;
}

.restaurant-card-skeleton .skeleton-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.restaurant-card-skeleton .skeleton-tag {
    height: 14px;
    width: 60px;
    border-radius: 4px;
}

.restaurant-card-skeleton .skeleton-rating {
    height: 14px;
    width: 40px;
    border-radius: 4px;
}

.restaurant-card-skeleton .skeleton-info {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.restaurant-card-skeleton .skeleton-info-item {
    height: 12px;
    width: 80px;
    border-radius: 4px;
}

/* ================================
   CUISINE CARD SKELETON - Circle only
   ================================ */
.cuisine-card-skeleton {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    width: 90px;
    background: transparent;
}

.cuisine-card-skeleton .skeleton-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
}

.cuisine-card-skeleton .skeleton-label {
    height: 12px;
    width: 50px;
    border-radius: 4px;
}

/* Inline skeleton styles in grids */
.cuisines-grid .skeleton-wrapper,
.restaurants-grid .skeleton-wrapper {
    display: contents;
}

.cuisines-grid .real-content,
.restaurants-grid .real-content {
    display: contents;
}

/* ================================
   PROMO CARD SKELETON
   ================================ */
.promo-card-skeleton {
    width: 85%;
    min-width: 280px;
    height: 160px;
    border-radius: 20px;
    flex-shrink: 0;
}

/* ================================
   FEATURE CARD SKELETON
   ================================ */
.feature-card-skeleton {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    min-width: 130px;
}

.feature-card-skeleton .skeleton-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
}

.feature-card-skeleton .skeleton-text {
    height: 14px;
    width: 80px;
    border-radius: 4px;
}

.feature-card-skeleton .skeleton-subtext {
    height: 10px;
    width: 60px;
    border-radius: 4px;
}

/* ================================
   MENU ITEM SKELETON
   ================================ */
.menu-item-skeleton {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 12px;
}

.menu-item-skeleton .skeleton-image {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    flex-shrink: 0;
}

.menu-item-skeleton .skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item-skeleton .skeleton-name {
    height: 18px;
    width: 80%;
    border-radius: 4px;
}

.menu-item-skeleton .skeleton-desc {
    height: 12px;
    width: 100%;
    border-radius: 4px;
}

.menu-item-skeleton .skeleton-desc-short {
    height: 12px;
    width: 60%;
    border-radius: 4px;
}

.menu-item-skeleton .skeleton-price {
    height: 16px;
    width: 50px;
    border-radius: 4px;
    margin-top: auto;
}

/* ================================
   SEARCH RESULT SKELETON
   ================================ */
.search-result-skeleton {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}

.search-result-skeleton .skeleton-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.search-result-skeleton .skeleton-text {
    height: 16px;
    width: 150px;
    border-radius: 4px;
}

/* ================================
   ORDER CARD SKELETON
   ================================ */
.order-card-skeleton {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.order-card-skeleton .skeleton-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.order-card-skeleton .skeleton-restaurant {
    height: 18px;
    width: 120px;
    border-radius: 4px;
}

.order-card-skeleton .skeleton-status {
    height: 24px;
    width: 80px;
    border-radius: 12px;
}

.order-card-skeleton .skeleton-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.order-card-skeleton .skeleton-item {
    height: 14px;
    width: 70%;
    border-radius: 4px;
}

.order-card-skeleton .skeleton-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-card-skeleton .skeleton-date {
    height: 12px;
    width: 100px;
    border-radius: 4px;
}

.order-card-skeleton .skeleton-total {
    height: 18px;
    width: 60px;
    border-radius: 4px;
}

/* ================================
   CONTAINER HELPERS
   ================================ */
.skeleton-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 4px;
}

.skeleton-row::-webkit-scrollbar {
    display: none;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ================================
   MOBILE SPECIFIC
   ================================ */
@media (max-width: 768px) {
    .restaurant-card-skeleton .skeleton-image {
        height: 160px;
    }

    .skeleton-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cuisine-card-skeleton .skeleton-icon {
        width: 60px;
        height: 60px;
    }

    .menu-item-skeleton .skeleton-image {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .restaurant-card-skeleton .skeleton-image {
        height: 140px;
    }

    .cuisine-card-skeleton .skeleton-icon {
        width: 56px;
        height: 56px;
    }
}

/* ================================
   FADE IN ANIMATION FOR CONTENT
   ================================ */
.skeleton-loaded {
    animation: skeleton-fade-in 0.3s ease-out;
}

@keyframes skeleton-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide skeleton when content loaded */
.content-loaded .skeleton-wrapper {
    display: none;
}

.content-loaded .real-content {
    display: block;
}

/* Show skeleton, hide content by default */
.skeleton-wrapper {
    display: block;
}

.real-content {
    display: none;
}

.content-loaded .real-content {
    display: block;
    animation: skeleton-fade-in 0.3s ease-out;
}
