/* Loading Optimizations CSS */

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
    min-height: 60px;
}

.loading-spinner::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #EDD2A1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Professional option card styling - Boxes style */
.option-card {
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    background: white;
    margin-bottom: 15px;
}

.option-card:hover {
    border-color: #EDD2A1;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(237, 210, 161, 0.3);
}

.option-card.selected {
    border-color: #272727;
    background: linear-gradient(135deg, #f9f9f9, #ffffff);
    box-shadow: 0 8px 25px rgba(39, 39, 39, 0.2);
}

.option-card.selected::after {
    content: '✓';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    background: #272727;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.option-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.option-name {
    font-weight: 700;
    font-size: 16px;
    color: #272727;
    flex: 1;
    text-align: left;
    line-height: 1.4;
}

.veg-indicator {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 2px solid;
    flex-shrink: 0;
    margin-left: 12px;
    position: relative;
}

.veg-indicator.veg {
    background-color: #27ae60;
    border-color: #229954;
}

.veg-indicator.non-veg {
    background-color: #e74c3c;
    border-color: #c0392b;
}

.veg-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

/* Grid layout improvements */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    padding: 20px;
}

/* Skeleton loading */
.skeleton-card {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 12px;
    height: 80px;
    margin-bottom: 15px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .options-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 15px;
    }
    
    .option-card {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .option-name {
        font-size: 14px;
    }
    
    .veg-indicator {
        width: 14px;
        height: 14px;
        margin-left: 8px;
    }
    
    .veg-indicator::after {
        width: 4px;
        height: 4px;
    }
    
    .skeleton-card {
        height: 65px;
    }
}

/* Optimized transitions */
.option-card {
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    will-change: transform;
}

.option-card:hover {
    transform: translateY(-2px);
}

/* Reduce layout shifts */
.options-grid {
    min-height: 200px;
}

/* Performance hints */
.selection-section {
    contain: layout style paint;
}

.option-card {
    contain: layout style;
}

/* Lazy loading fade-in */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.3s ease-in-out forwards;
}

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

/* Mobile optimizations */
@media (max-width: 768px) {
    .loading-spinner {
        min-height: 40px;
        padding: 15px;
        font-size: 12px;
    }
    
    .loading-spinner::before {
        width: 16px;
        height: 16px;
        margin-right: 8px;
    }
    
    .skeleton-card {
        height: 50px;
        margin-bottom: 8px;
    }
}