/* Modern Course Card Styles - Premium Edition */

.course-modern-card {
    background:
        radial-gradient(1200px 600px at 15% -10%, rgba(232, 90, 138, 0.10) 0%, transparent 55%),
        radial-gradient(900px 450px at 110% 10%, rgba(144, 29, 71, 0.12) 0%, transparent 60%),
        linear-gradient(155deg, rgba(30, 33, 48, 0.92) 0%, rgba(23, 26, 35, 0.98) 100%);
    border-radius: 22px;
    overflow: hidden;
    box-shadow:
        0 14px 34px -18px rgba(0, 0, 0, 0.65),
        0 26px 70px -40px rgba(0, 0, 0, 0.80),
        0 18px 40px -28px rgba(232, 90, 138, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
    transition:
        transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.course-modern-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 22px;
    padding: 1px;
    background: linear-gradient(135deg, 
        rgba(144, 29, 71, 0.8) 0%, 
        rgba(232, 90, 138, 0.4) 25%,
        rgba(30, 33, 48, 0.2) 50%,
        rgba(144, 29, 71, 0.3) 75%,
        rgba(232, 90, 138, 0.2) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

[data-bs-theme="dark"] .course-modern-card {
    background:
        radial-gradient(1200px 600px at 15% -10%, rgba(232, 90, 138, 0.10) 0%, transparent 55%),
        radial-gradient(900px 450px at 110% 10%, rgba(144, 29, 71, 0.12) 0%, transparent 60%),
        linear-gradient(155deg, rgba(30, 33, 48, 0.92) 0%, rgba(23, 26, 35, 0.98) 100%);
}

[data-bs-theme="light"] .course-modern-card,
html:not([data-bs-theme="dark"]) .course-modern-card {
    background:
        radial-gradient(900px 520px at 12% -10%, rgba(232, 90, 138, 0.10) 0%, transparent 60%),
        radial-gradient(820px 520px at 110% 10%, rgba(144, 29, 71, 0.08) 0%, transparent 65%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 250, 252, 0.92) 100%);
    border-color: rgba(17, 24, 39, 0.14);
    box-shadow:
        0 18px 44px -28px rgba(17, 24, 39, 0.22),
        0 34px 90px -64px rgba(17, 24, 39, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

[data-bs-theme="light"] .course-modern-card::before,
html:not([data-bs-theme="dark"]) .course-modern-card::before {
    background: linear-gradient(135deg,
        rgba(144, 29, 71, 0.32) 0%,
        rgba(232, 90, 138, 0.18) 25%,
        rgba(255, 255, 255, 0.60) 50%,
        rgba(144, 29, 71, 0.16) 75%,
        rgba(232, 90, 138, 0.12) 100%);
}

[data-bs-theme="dark"] #packages .btn.btn-outline-secondary {
    color: var(--theme-text-main);
    border-color: rgba(255,255,255,0.28);
}

[data-bs-theme="dark"] #packages .btn.btn-outline-secondary:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.36);
    color: var(--theme-text-main);
}

@media (hover: hover) and (pointer: fine) {
    .course-modern-card {
        will-change: transform;
    }
    
    .course-modern-card:hover {
        transform: translateY(-10px);
        box-shadow:
            0 18px 44px -22px rgba(0, 0, 0, 0.75),
            0 34px 90px -52px rgba(0, 0, 0, 0.90),
            0 28px 64px -44px rgba(232, 90, 138, 0.30),
            inset 0 1px 0 rgba(255, 255, 255, 0.12),
            0 0 0 1px rgba(232, 90, 138, 0.12);
        border-color: rgba(232, 90, 138, 0.18);
    }
    
    .course-modern-card:hover::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 22px;
        background: linear-gradient(135deg, 
            rgba(144, 29, 71, 0.1) 0%, 
            transparent 50%,
            rgba(232, 90, 138, 0.05) 100%);
        pointer-events: none;
        opacity: 1;
        transition: opacity 0.3s ease;
    }
}

.course-modern-media {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    backface-visibility: hidden;
}

.course-modern-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 50%,
        rgba(23, 26, 35, 0.4) 75%,
        rgba(23, 26, 35, 0.9) 100%
    );
    pointer-events: none;
    z-index: 1;
}

[data-bs-theme="light"] .course-modern-media::after,
html:not([data-bs-theme="dark"]) .course-modern-media::after {
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 52%,
        rgba(255, 255, 255, 0.24) 80%,
        rgba(255, 255, 255, 0.60) 100%
    );
}

.course-modern-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02) translateZ(0);
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    backface-visibility: hidden;
}

@media (hover: hover) and (pointer: fine) {
    .course-modern-card:hover .course-modern-media img {
        transform: scale(1.10) translateZ(0);
    }
    
    .course-modern-card:hover .course-modern-media::before {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(
            ellipse at center,
            transparent 0%,
            rgba(144, 29, 71, 0.1) 100%
        );
        z-index: 2;
        pointer-events: none;
    }
}

.course-modern-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-600) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.course-modern-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    backdrop-filter: blur(14px) saturate(190%);
    -webkit-backdrop-filter: blur(14px) saturate(190%);
    z-index: 3;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(144, 29, 71, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.badge-popular { 
    background: linear-gradient(135deg, rgba(144, 29, 71, 0.9) 0%, rgba(104, 22, 53, 0.95) 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.badge-popular::before {
    content: '\f005';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 6px;
    font-size: 0.65rem;
}

[data-bs-theme="dark"] .badge-popular {
    color: #ffffff;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(144, 29, 71, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.badge-discount { 
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.9) 0%, rgba(185, 28, 28, 0.95) 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.badge-discount::before {
    content: '\f0a3';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 6px;
    font-size: 0.65rem;
}

.badge-access { 
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.9) 0%, rgba(21, 94, 59, 0.95) 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.badge-access::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 6px;
    font-size: 0.65rem;
}

.course-modern-content {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

[data-bs-theme="light"] .course-modern-content,
html:not([data-bs-theme="dark"]) .course-modern-content {
    color: rgba(17, 24, 39, 0.92);
}

.course-modern-title {
    font-size: 1.12rem;
    font-weight: 750;
    line-height: 1.32;
    letter-spacing: -0.01em;
    margin: 0 0 12px 0;
}

.course-modern-title a {
    color: inherit;
    text-decoration: none;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

[data-bs-theme="light"] .course-modern-actions .btn,
html:not([data-bs-theme="dark"]) .course-modern-actions .btn {
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.10);
}

[data-bs-theme="light"] .course-modern-description,
html:not([data-bs-theme="dark"]) .course-modern-description {
    color: rgba(75, 85, 99, 0.94);
}

[data-bs-theme="light"] .price-original,
html:not([data-bs-theme="dark"]) .price-original {
    color: rgba(107, 114, 128, 0.95);
    opacity: 0.85;
}

.course-modern-title a:hover {
    color: var(--bs-primary);
}

[data-bs-theme="light"] .course-modern-title,
[data-bs-theme="light"] .course-modern-title a,
html:not([data-bs-theme="dark"]) .course-modern-title,
html:not([data-bs-theme="dark"]) .course-modern-title a {
    color: rgba(17, 24, 39, 0.95);
}

.course-modern-instructor {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.instructor-avatar, .instructor-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.instructor-avatar-placeholder {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-600));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.instructor-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--theme-text-main);
}

[data-bs-theme="light"] .instructor-name,
html:not([data-bs-theme="dark"]) .instructor-name {
    color: rgba(17, 24, 39, 0.86);
}

.instructor-role {
    font-size: 0.8rem;
    color: var(--theme-text-muted);
    margin-left: auto;
}

[data-bs-theme="light"] .instructor-role,
html:not([data-bs-theme="dark"]) .instructor-role {
    color: rgba(75, 85, 99, 0.92);
}

.course-modern-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--theme-border-subtle);
}

[data-bs-theme="light"] .course-modern-meta,
html:not([data-bs-theme="dark"]) .course-modern-meta {
    border-bottom-color: rgba(17, 24, 39, 0.10);
}

[data-bs-theme="dark"] .course-modern-meta {
    border-bottom-color: var(--theme-border-subtle);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--theme-text-muted);
}

[data-bs-theme="light"] .meta-item,
html:not([data-bs-theme="dark"]) .meta-item {
    color: rgba(75, 85, 99, 0.94);
}

.meta-item i {
    opacity: 0.7;
}

.course-modern-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--theme-text-muted);
    margin-bottom: 14px;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-modern-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.stars {
    display: flex;
    gap: 2px;
}

.stars i {
    color: var(--theme-border-subtle);
    font-size: 0.875rem;
}

[data-bs-theme="light"] .stars i,
html:not([data-bs-theme="dark"]) .stars i {
    color: rgba(17, 24, 39, 0.18);
}

[data-bs-theme="dark"] .stars i {
    color: var(--theme-border-subtle);
}

.stars i.filled {
    color: var(--brand-gold);
}

.rating-score {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--theme-text-main);
}

[data-bs-theme="light"] .rating-score,
html:not([data-bs-theme="dark"]) .rating-score {
    color: rgba(17, 24, 39, 0.88);
}

.reviews-count {
    font-size: 0.8rem;
    color: var(--theme-text-muted);
}

[data-bs-theme="light"] .reviews-count,
html:not([data-bs-theme="dark"]) .reviews-count {
    color: rgba(75, 85, 99, 0.92);
}

.course-modern-price {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

[data-bs-theme="light"] .course-modern-price,
html:not([data-bs-theme="dark"]) .course-modern-price {
    border-top-color: rgba(17, 24, 39, 0.10);
}

.price-original {
    font-size: 0.9rem;
    color: var(--theme-text-muted);
    text-decoration: line-through;
    opacity: 0.7;
}

.price-current {
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(135deg, #e85a8a 0%, #ff6b9d 50%, #ffb8d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

[data-bs-theme="light"] .price-current,
html:not([data-bs-theme="dark"]) .price-current {
    background: linear-gradient(135deg, #901d47 0%, #e85a8a 55%, #ff6b9d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-current.access {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.1rem;
    font-weight: 700;
}

[data-bs-theme="dark"] .price-current.access {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-current.free {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-discount-badge {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

[data-bs-theme="light"] .price-discount-badge,
html:not([data-bs-theme="dark"]) .price-discount-badge {
    box-shadow:
        0 14px 30px rgba(220, 53, 69, 0.22),
        0 6px 14px rgba(17, 24, 39, 0.08);
    border-color: rgba(255, 255, 255, 0.55);
}

.course-modern-actions {
    display: flex;
    gap: 12px;
}

.course-modern-actions .btn {
    flex: 1;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.course-modern-actions .btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.course-modern-actions .btn:hover::before {
    opacity: 1;
}

.course-modern-actions .btn-details {
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.9);
}

[data-bs-theme="light"] .course-modern-actions .btn-details,
html:not([data-bs-theme="dark"]) .course-modern-actions .btn-details {
    border-color: rgba(17, 24, 39, 0.16);
    background: rgba(255, 255, 255, 0.92);
    color: rgba(17, 24, 39, 0.86);
    box-shadow:
        0 10px 24px rgba(17, 24, 39, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.course-modern-actions .btn-details:hover {
    border-color: rgba(232, 90, 138, 0.5);
    background: rgba(232, 90, 138, 0.1);
    color: #e85a8a;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(232, 90, 138, 0.2);
}

[data-bs-theme="light"] .course-modern-actions .btn-details:hover,
html:not([data-bs-theme="dark"]) .course-modern-actions .btn-details:hover {
    background: rgba(232, 90, 138, 0.10);
    border-color: rgba(144, 29, 71, 0.30);
    box-shadow: 0 12px 30px rgba(144, 29, 71, 0.18);
}

[data-bs-theme="light"] .course-modern-actions .btn-join,
html:not([data-bs-theme="dark"]) .course-modern-actions .btn-join {
    background: linear-gradient(135deg, #9b2250 0%, #7a1a3d 55%, #4a0f26 100%);
    box-shadow:
        0 18px 44px rgba(144, 29, 71, 0.26),
        0 10px 20px rgba(17, 24, 39, 0.08);
}

[data-bs-theme="light"] .course-modern-actions .btn-join:hover,
html:not([data-bs-theme="dark"]) .course-modern-actions .btn-join:hover {
    background: linear-gradient(135deg, #aa2a5c 0%, #861f45 55%, #55112b 100%);
    box-shadow:
        0 22px 56px rgba(144, 29, 71, 0.28),
        0 12px 26px rgba(17, 24, 39, 0.10);
}

.course-modern-actions .btn-join {
    background: linear-gradient(135deg, #901d47 0%, #681635 50%, #4a0f26 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(144, 29, 71, 0.4);
}

.course-modern-actions .btn-join:hover {
    background: linear-gradient(135deg, #a62455 0%, #7a1a3d 50%, #5a1330 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(144, 29, 71, 0.5);
}

.course-modern-actions .btn-join:active {
    transform: translateY(0);
}

.course-modern-actions .btn i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.course-modern-actions .btn:hover i {
    transform: translateX(3px);
}

@media (max-width: 575.98px) {
    .course-modern-content {
        padding: 18px;
    }

    .course-modern-title {
        font-size: 1.05rem;
    }

    .course-modern-actions .btn {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

.course-modern-card:focus-within {
    border-color: rgba(232, 90, 138, 0.28);
    box-shadow:
        0 14px 34px -18px rgba(0, 0, 0, 0.65),
        0 26px 70px -40px rgba(0, 0, 0, 0.80),
        0 0 0 4px rgba(232, 90, 138, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.course-modern-title a:focus-visible,
.course-modern-actions .btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(232, 90, 138, 0.22);
}

@media (prefers-reduced-motion: reduce) {
    .course-modern-card,
    .course-modern-media img,
    .course-modern-actions .btn,
    .course-modern-actions .btn i {
        transition: none !important;
    }
}

/* Dark mode button contrast fixes for checkout/bank transfer page */
html[data-bs-theme="dark"] .btn-primary,
body[data-bs-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #681635 0%, #3d0d20 100%);
    border-color: rgba(255,255,255,0.12);
    color: #ffffff;
}

html[data-bs-theme="dark"] .btn-primary:hover,
body[data-bs-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, #7a1a3d 0%, #4b1027 100%);
    border-color: rgba(255,255,255,0.16);
    color: #ffffff;
}

html[data-bs-theme="dark"] .btn-outline-secondary,
body[data-bs-theme="dark"] .btn-outline-secondary {
    color: var(--theme-text-main);
    border-color: rgba(255,255,255,0.32);
    background: rgba(255,255,255,0.04);
}

html[data-bs-theme="dark"] .btn-outline-secondary:hover,
body[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.4);
    color: #ffffff;
}
