/* ========================================
   PREMIUM CARD DESIGN SYSTEM
   Elegant, Elevated Cards for Mobile Excellence
   ======================================== */

/* ========================================
   BASE CARD STRUCTURE
   ======================================== */

.premium-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform, box-shadow;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Elevated state on tap/hover */
.premium-card:active {
    transform: translateY(-8px) scale(0.98);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.15);
}

/* ========================================
   CARD IMAGE HEADER
   ======================================== */

.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-card:active .card-image {
    transform: scale(1.08);
}

/* Gradient Overlay */
.card-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        transparent 100%
    );
    z-index: 1;
}

/* Optional: Category Badge on Image */
.card-category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #fff;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    animation: badgeSlide 0.6s ease-out 0.3s backwards;
}

@keyframes badgeSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   CARD CONTENT
   ======================================== */

.card-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
}

/* Service Icon Badge */
.service-icon-badge {
    position: absolute;
    top: -25px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    z-index: 2;
}

.service-icon-badge i {
    color: #fff;
    font-size: 24px;
}

/* Meta Information (for blogs) */
.card-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #999;
    animation: fadeIn 0.6s ease-out 0.4s backwards;
}

.card-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-meta-item i {
    color: #007bff;
    font-size: 12px;
}

/* Card Title */
.card-title {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    color: #1a1d20;
    margin-bottom: 15px;
    letter-spacing: -0.3px;
    animation: fadeInUp 0.6s ease-out 0.5s backwards;
}

.card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.card-title a:hover {
    color: #007bff;
}

/* Card Description */
.card-description {
    font-size: 15px;
    line-height: 1.7;
    color: #666;
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease-out 0.6s backwards;
}

/* Card Features/Tags */
.card-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    animation: fadeInUp 0.6s ease-out 0.7s backwards;
}

.card-features li {
    padding: 8px 0;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-features li i {
    color: #28a745;
    font-size: 14px;
    flex-shrink: 0;
}

/* Card Price (for services) */
.card-price {
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease-out 0.7s backwards;
}

.card-price-badge {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* ========================================
   CALL-TO-ACTION BUTTON
   ======================================== */

.card-cta {
    margin-top: 20px;
    animation: fadeInUp 0.6s ease-out 0.8s backwards;
}

.card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: #fff;
    color: #007bff;
    font-size: 16px;
    font-weight: 700;
    border: 2px solid #007bff;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* Ripple effect container */
.card-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.card-btn:active::before {
    width: 400px;
    height: 400px;
}

.card-btn:active {
    transform: translateY(-2px) scale(0.98);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    background: #007bff;
    color: #fff;
}

.card-btn i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.card-btn:active i {
    transform: translateX(5px);
}

/* Secondary CTA Button */
.card-btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
}

.card-btn-secondary:active {
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

/* ========================================
   CARD ICON (for services without images)
   ======================================== */

.card-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    position: relative;
    overflow: hidden;
}

.card-icon-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: iconGlow 8s ease-in-out infinite;
}

@keyframes iconGlow {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(20px, 20px);
    }
}

.card-icon {
    font-size: 64px;
    color: #fff;
    z-index: 1;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ========================================
   VIEWPORT ANIMATIONS
   ======================================== */

/* Initial hidden state - removed to show cards immediately */
.premium-card {
    opacity: 1;
    transform: translateY(0);
}

/* Animated state when in viewport */
.premium-card.in-view {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Stagger animation delays */
.premium-card:nth-child(1) { transition-delay: 0.1s; }
.premium-card:nth-child(2) { transition-delay: 0.2s; }
.premium-card:nth-child(3) { transition-delay: 0.3s; }
.premium-card:nth-child(4) { transition-delay: 0.4s; }
.premium-card:nth-child(5) { transition-delay: 0.5s; }
.premium-card:nth-child(6) { transition-delay: 0.6s; }

/* ========================================
   MOBILE OPTIMIZATIONS
   ======================================== */

@media (max-width: 768px) {
    /* Single column layout */
    .premium-card {
        margin-bottom: 25px;
        border-radius: 20px;
    }

    .card-image-wrapper {
        height: 220px;
    }

    .card-content {
        padding: 25px 20px 20px;
    }

    /* Service Icon Badge - Mobile */
    .service-icon-badge {
        width: 45px;
        height: 45px;
        top: -22px;
        left: 20px;
    }

    .service-icon-badge i {
        font-size: 20px;
    }

    .card-title {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .card-description {
        font-size: 15px;
        margin-bottom: 18px;
    }

    .card-btn {
        padding: 15px 20px;
        font-size: 15px;
    }

    /* Optimize tap targets */
    .card-btn,
    .card-title a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

@media (max-width: 576px) {
    .card-image-wrapper {
        height: 200px;
    }

    .card-content {
        padding: 20px 18px 18px;
    }

    /* Service Icon Badge - Small Mobile */
    .service-icon-badge {
        width: 40px;
        height: 40px;
        top: -20px;
        left: 18px;
    }

    .service-icon-badge i {
        font-size: 18px;
    }

    .card-title {
        font-size: 19px;
    }

    .card-description {
        font-size: 14px;
    }

    .card-btn {
        padding: 14px 18px;
        font-size: 14px;
    }
}

/* ========================================
   BLOG CARD SPECIFIC STYLES
   ======================================== */

.blog-card .card-image-wrapper {
    height: 240px;
}

.blog-card .card-meta {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.blog-card .card-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.blog-card .author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #007bff;
}

.blog-card .author-info {
    flex: 1;
}

.blog-card .author-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1d20;
    margin-bottom: 2px;
}

.blog-card .author-role {
    font-size: 12px;
    color: #999;
}

/* ========================================
   SERVICE CARD SPECIFIC STYLES
   ======================================== */

.service-card .card-icon-wrapper {
    height: 160px;
}

.service-card .card-features {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
}

.service-card .card-features li {
    padding: 6px 0;
}

/* ========================================
   LOADING SKELETON
   ======================================== */

.card-skeleton {
    background: #fff;
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.skeleton-image {
    width: 100%;
    height: 240px;
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-content {
    padding: 25px 20px;
}

.skeleton-title {
    height: 24px;
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
    margin-bottom: 15px;
}

.skeleton-text {
    height: 16px;
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
    margin-bottom: 10px;
}

.skeleton-button {
    height: 48px;
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 50px;
    margin-top: 20px;
}

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

/* ========================================
   ACCESSIBILITY
   ======================================== */

.card-btn:focus,
.card-title a:focus {
    outline: 3px solid rgba(0, 123, 255, 0.5);
    outline-offset: 2px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .premium-card,
    .card-image,
    .card-btn,
    .card-icon {
        animation: none !important;
        transition: none !important;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .premium-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    .card-btn {
        display: none;
    }
}
