/**
 * Loading Skeleton System
 * Reusable skeleton loaders for better UX
 */

/* Base Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

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

/* Skeleton Variants */
.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 2rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-subtitle {
    height: 1.5rem;
    width: 40%;
    margin-bottom: 0.75rem;
}

.skeleton-paragraph {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-paragraph:last-child {
    width: 80%;
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.skeleton-button {
    height: 40px;
    border-radius: 8px;
}

.skeleton-card {
    height: 200px;
    border-radius: 12px;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: 8px;
}

.skeleton-badge {
    height: 24px;
    width: 60px;
    border-radius: 12px;
    display: inline-block;
}

/* ISP Card Skeleton */
.skeleton-isp-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.skeleton-isp-card .skeleton-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.skeleton-isp-card .skeleton-logo {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    margin-right: 1rem;
}

.skeleton-isp-card .skeleton-info {
    flex: 1;
}

.skeleton-isp-card .skeleton-name {
    height: 1.5rem;
    width: 50%;
    margin-bottom: 0.5rem;
}

.skeleton-isp-card .skeleton-rating {
    height: 1rem;
    width: 30%;
}

.skeleton-isp-card .skeleton-description {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-isp-card .skeleton-stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.skeleton-isp-card .skeleton-stat {
    height: 3rem;
    flex: 1;
    border-radius: 8px;
}

/* Review Card Skeleton */
.skeleton-review-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.skeleton-review-card .skeleton-user {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.skeleton-review-card .skeleton-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 1rem;
}

.skeleton-review-card .skeleton-user-info {
    flex: 1;
}

.skeleton-review-card .skeleton-user-name {
    height: 1.25rem;
    width: 40%;
    margin-bottom: 0.5rem;
}

.skeleton-review-card .skeleton-user-date {
    height: 0.875rem;
    width: 30%;
}

.skeleton-review-card .skeleton-content {
    height: 1rem;
    margin-bottom: 0.5rem;
}

/* Table Skeleton */
.skeleton-table {
    width: 100%;
}

.skeleton-table-row {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.skeleton-table-cell {
    height: 1.5rem;
    flex: 1;
}

/* List Skeleton */
.skeleton-list-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.skeleton-list-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 1rem;
}

.skeleton-list-content {
    flex: 1;
}

.skeleton-list-title {
    height: 1.25rem;
    width: 60%;
    margin-bottom: 0.5rem;
}

.skeleton-list-subtitle {
    height: 1rem;
    width: 40%;
}

/* Chart Skeleton */
.skeleton-chart {
    height: 300px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.skeleton-chart::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 4px solid #e0e0e0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: skeleton-spin 1s linear infinite;
}

@keyframes skeleton-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Stats Skeleton */
.skeleton-stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.skeleton-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 1rem;
}

.skeleton-stat-value {
    height: 3rem;
    width: 60%;
    margin: 0 auto 0.5rem;
}

.skeleton-stat-label {
    height: 1rem;
    width: 40%;
    margin: 0 auto;
}

/* Search Results Skeleton */
.skeleton-search-result {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.skeleton-search-result .skeleton-result-title {
    height: 1.5rem;
    width: 70%;
    margin-bottom: 0.75rem;
}

.skeleton-search-result .skeleton-result-description {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-search-result .skeleton-result-meta {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.skeleton-search-result .skeleton-result-badge {
    height: 1.5rem;
    width: 80px;
    border-radius: 12px;
}

/* Package Card Skeleton */
.skeleton-package-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
}

.skeleton-package-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.skeleton-package-name {
    height: 1.5rem;
    width: 60%;
    margin: 0 auto 1rem;
}

.skeleton-package-price {
    height: 3rem;
    width: 50%;
    margin: 0 auto;
}

.skeleton-package-features {
    margin: 1.5rem 0;
}

.skeleton-package-feature {
    height: 1.25rem;
    margin-bottom: 0.75rem;
}

.skeleton-package-button {
    height: 48px;
    border-radius: 24px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .skeleton {
        background: linear-gradient(90deg, #2d3748 25%, #1a202c 50%, #2d3748 75%);
        background-size: 200% 100%;
    }
    
    .skeleton-isp-card,
    .skeleton-review-card,
    .skeleton-search-result,
    .skeleton-package-card,
    .skeleton-stat-card {
        background: #1a202c;
        border-color: #2d3748;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .skeleton-isp-card,
    .skeleton-review-card,
    .skeleton-search-result {
        padding: 1rem;
    }
    
    .skeleton-isp-card .skeleton-logo {
        width: 48px;
        height: 48px;
    }
    
    .skeleton-stat-card {
        padding: 1rem;
    }
}

/* Utility Classes */
.skeleton-container {
    padding: 1rem;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.skeleton-pulse {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

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

/* Hide content while loading */
.loading .content {
    display: none;
}

.loading .skeleton-loader {
    display: block;
}

.skeleton-loader {
    display: none;
}
