/* Skeleton Loader Styles */

/* Modern shimmer animation */
@keyframes skeleton-shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Wave animation for cards */
@keyframes skeleton-wave {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Pulse animation */
@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.7;
    }
}

/* Glow animation */
@keyframes skeleton-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 163, 127, 0.1);
    }
    50% {
        box-shadow: 0 0 20px 0 rgba(16, 163, 127, 0.1);
    }
}

.skeleton {
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.01) 20%,
        rgba(255, 255, 255, 0.03) 40%,
        rgba(255, 255, 255, 0.04) 50%,
        rgba(255, 255, 255, 0.03) 60%,
        rgba(255, 255, 255, 0.01) 80%,
        rgba(255, 255, 255, 0) 100%
    );
    background-color: var(--bg-tertiary);
    background-size: 1000px 100%;
    animation: skeleton-shimmer 2s ease-in-out infinite;
    border-radius: 8px;
}

/* Add wave effect overlay for cards */
.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    transform: translateX(-100%);
    animation: skeleton-wave 1.8s ease-in-out infinite;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-text.small {
    height: 12px;
    width: 60%;
}

.skeleton-text.medium {
    height: 14px;
    width: 80%;
}

.skeleton-text.large {
    height: 20px;
    width: 40%;
}

.skeleton-button {
    height: 44px;
    border-radius: 8px;
    margin-top: 20px;
}

/* Pricing Card Skeleton */
.skeleton-pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    height: 520px;
    position: relative;
    overflow: hidden;
    animation: skeleton-glow 2s ease-in-out infinite;
    transition: transform 0.3s ease;
}

/* Add subtle scale animation to cards */
.skeleton-pricing-card:nth-child(1) {
    animation-delay: 0s;
}

.skeleton-pricing-card:nth-child(2) {
    animation-delay: 0.2s;
}

.skeleton-pricing-card:nth-child(3) {
    animation-delay: 0.4s;
}

/* Staggered fade-in effect */
@keyframes skeleton-fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.skeleton-pricing-card {
    animation: skeleton-fadeIn 0.5s ease forwards, skeleton-glow 2s ease-in-out infinite;
}

.skeleton-plan-header {
    text-align: center;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 25px;
}

.skeleton-plan-name {
    width: 100px;
    height: 28px;
    margin: 0 auto 15px;
}

.skeleton-plan-price {
    width: 120px;
    height: 48px;
    margin: 0 auto 10px;
}

.skeleton-plan-desc {
    width: 180px;
    height: 14px;
    margin: 0 auto;
}

.skeleton-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.skeleton-feature-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-feature-text {
    flex: 1;
    height: 16px;
}

/* Dashboard Card Skeleton */
.skeleton-stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    height: 180px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
    animation: skeleton-fadeIn 0.6s ease forwards;
    border: 1px solid var(--border-color);
}

/* Staggered animations for stat cards */
.skeleton-stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.skeleton-stat-card:nth-child(2) {
    animation-delay: 0.2s;
}

.skeleton-stat-card:nth-child(3) {
    animation-delay: 0.3s;
}

/* Add breathing effect to stat cards */
@keyframes skeleton-breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.02);
        opacity: 1;
    }
}

.skeleton-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        transparent,
        rgba(16, 163, 127, 0.03),
        transparent
    );
    animation: skeleton-wave 2s ease-in-out infinite;
}

.skeleton-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
}

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

.skeleton-stat-value {
    height: 36px;
    width: 120px;
    margin-bottom: 8px;
}

.skeleton-stat-label {
    height: 16px;
    width: 100px;
}

.skeleton-progress-bar {
    height: 8px;
    width: 100%;
    margin-top: 12px;
}

/* Activity List Skeleton */
.skeleton-activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 12px;
}

.skeleton-activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-activity-info {
    flex: 1;
}

.skeleton-activity-title {
    height: 16px;
    width: 140px;
    margin-bottom: 8px;
}

.skeleton-activity-meta {
    height: 12px;
    width: 200px;
}

/* Free Plan Banner Skeleton */
.skeleton-free-banner {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skeleton-free-info {
    flex: 1;
}

.skeleton-free-title {
    height: 20px;
    width: 150px;
    margin-bottom: 8px;
}

.skeleton-free-desc {
    height: 14px;
    width: 300px;
}

.skeleton-free-button {
    width: 140px;
    height: 40px;
    border-radius: 6px;
}

/* Pulse animation variant */
@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.skeleton-pulse {
    background: var(--bg-tertiary);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* Table Skeleton */
.skeleton-table-row {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    gap: 20px;
    animation: skeleton-fadeIn 0.4s ease forwards;
}

.skeleton-table-row:nth-child(odd) {
    animation-delay: 0.1s;
}

.skeleton-table-row:nth-child(even) {
    animation-delay: 0.2s;
}

.skeleton-table-cell {
    height: 16px;
    flex: 1;
    background: var(--bg-tertiary);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton-table-cell::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.04),
        transparent
    );
    animation: skeleton-wave 1.5s ease-in-out infinite;
}

.skeleton-table-cell.small {
    flex: 0.5;
}

.skeleton-table-cell.large {
    flex: 2;
}

/* Billing Page Skeleton */
.skeleton-current-plan {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    animation: skeleton-fadeIn 0.5s ease forwards, skeleton-glow 2.5s ease-in-out infinite;
}

.skeleton-plan-info {
    margin-bottom: 20px;
}

.skeleton-plan-title {
    height: 24px;
    width: 150px;
    margin-bottom: 12px;
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0%,
        rgba(255, 255, 255, 0.02) 50%,
        var(--bg-tertiary) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

.skeleton-plan-credits {
    height: 16px;
    width: 200px;
    margin-bottom: 8px;
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0%,
        rgba(255, 255, 255, 0.02) 50%,
        var(--bg-tertiary) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    animation-delay: 0.1s;
    border-radius: 4px;
}

.skeleton-plan-expires {
    height: 14px;
    width: 180px;
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0%,
        rgba(255, 255, 255, 0.02) 50%,
        var(--bg-tertiary) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    animation-delay: 0.2s;
    border-radius: 4px;
}

.skeleton-usage-bar {
    margin-top: 20px;
}

.skeleton-usage-progress {
    height: 12px;
    width: 100%;
    margin-bottom: 8px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.skeleton-usage-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    height: 100%;
    width: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(16, 163, 127, 0.1),
        transparent
    );
    animation: skeleton-wave 2s ease-in-out infinite;
}

.skeleton-usage-text {
    height: 14px;
    width: 150px;
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0%,
        rgba(255, 255, 255, 0.02) 50%,
        var(--bg-tertiary) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    animation-delay: 0.3s;
    border-radius: 4px;
}

/* Container for skeleton layouts */
.skeleton-container {
    padding: 20px;
    animation: skeleton-fadeIn 0.3s ease forwards;
}

.skeleton-grid {
    display: grid;
    gap: 20px;
}

.skeleton-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.skeleton-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* Add depth with subtle shadows during loading */
.skeleton-pricing-card,
.skeleton-stat-card,
.skeleton-current-plan {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

/* Enhance skeleton base animation */
.skeleton {
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0%,
        rgba(255, 255, 255, 0.01) 20%,
        rgba(255, 255, 255, 0.03) 40%,
        rgba(255, 255, 255, 0.04) 50%,
        rgba(255, 255, 255, 0.03) 60%,
        rgba(255, 255, 255, 0.01) 80%,
        var(--bg-tertiary) 100%
    );
    background-size: 1000px 100%;
    animation: skeleton-shimmer 2s ease-in-out infinite;
    border-radius: 8px;
}

/* Smooth transition when content loads */
@keyframes skeleton-fadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.skeleton-hiding {
    animation: skeleton-fadeOut 0.3s ease forwards;
}

/* Add subtle breathing effect to all skeleton elements */
.skeleton-text,
.skeleton-button,
.skeleton-feature-icon,
.skeleton-feature-text,
.skeleton-stat-icon,
.skeleton-activity-icon {
    position: relative;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.skeleton-text::before,
.skeleton-button::before,
.skeleton-feature-icon::before,
.skeleton-feature-text::before,
.skeleton-stat-icon::before,
.skeleton-activity-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    height: 100%;
    width: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.03),
        transparent
    );
    animation: skeleton-wave 2s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 968px) {
    .skeleton-grid.cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .skeleton-grid.cols-3,
    .skeleton-grid.cols-2 {
        grid-template-columns: 1fr;
    }
    
    .skeleton-free-banner {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .skeleton-free-button {
        width: 100%;
    }
    
    /* Reduce animation intensity on mobile for performance */
    .skeleton::after,
    .skeleton-wave {
        animation-duration: 2.5s;
    }
}