/**
 * PinkCode Pricing Manager - Path Selection Styles
 * 
 * @package PinkCode_Pricing
 * @since 1.0.0
 * @author Pink Code Queen - Nariman Jafari
 */

/* ===================================
   Course Path Selection V2
   Flip & Fullscreen Overlay
   Pink Code Queen - Nariman Jafari
   https://pinkcodequeen.com
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* === Global & Backdrop === */
.path-selection-v2 {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    padding: 3rem 1.5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 50%, #f0fdf4 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    box-sizing: border-box;
    position: relative;
}

.path-selection-v2 * {
    box-sizing: border-box;
}

/* The dark background when card opens */
.ps-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.ps-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* === Header === */
.ps-header {
    text-align: center;
    margin-bottom: 3rem;
}

.ps-title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
}

.ps-subtitle {
    font-size: 1.1rem;
    color: #64748b;
    margin: 0;
}

/* === Cards Grid === */
.ps-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

/* === Card Wrapper (Keeps space in grid) === */
.ps-card-wrapper {
    position: relative;
    height: 480px;
    perspective: 1500px;
    z-index: 1;
}

/* When a card inside is open, boost wrapper z-index */
.ps-card-wrapper:has(.is-open) {
    z-index: 1000;
}

/* === The Card Itself === */
.ps-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
    cursor: default;
}

/* === ACTIVE STATE (Fullscreen Overlay) === */
.ps-card.is-open {
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) rotateY(180deg) !important;
    width: 90vw !important;
    max-width: 700px !important;
    height: auto !important;
    max-height: 90vh !important;
    z-index: 1001 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

/* === Faces === */
.ps-card-front,
.ps-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 24px;
    background: #ffffff;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

/* === Front Face === */
.ps-card-front {
    cursor: pointer;
    background: #ffffff;
    transition: transform 0.6s;
}

.ps-card-image {
    position: relative;
    height: 55%;
    overflow: hidden;
}

.ps-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ps-card-wrapper:hover .ps-card:not(.is-open) .ps-card-image img {
    transform: scale(1.05);
}

.ps-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.4) 100%);
}

.ps-card-content {
    padding: 2rem 1.5rem 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.ps-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.ps-card-tagline {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0 0 1.5rem 0;
    line-height: 1.4;
}

.ps-card-price {
    margin-top: auto;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.path-selection-v2 .price-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.03em;
}

.path-selection-v2 .price-period {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 500;
}

.ps-expand-btn {
    width: 100%;
    padding: 1rem;
    border: 2px solid #f1f5f9;
    background: #ffffff;
    border-radius: 12px;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.ps-expand-btn:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #1e293b;
}

.expand-arrow {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
}

/* === Back Face (The Details) === */
.ps-card-back {
    transform: rotateY(180deg);
    background: #ffffff;
    pointer-events: none;
    height: auto;
    min-height: 100%;
}

.ps-card.is-open .ps-card-back {
    pointer-events: auto;
    position: relative;
    height: auto;
    overflow-y: auto;
}

.ps-back-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    flex-shrink: 0;
}

.ps-back-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.ps-close-btn {
    background: #e2e8f0;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.ps-close-btn:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

/* Content Area */
.ps-details-scroll {
    padding: 1.25rem 1.5rem;
    overflow: visible;
    flex-grow: 0;
}

.ps-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #334155;
    margin-bottom: 1.25rem;
}

.ps-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 12px;
}

.ps-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #475569;
    font-weight: 500;
}

.path-selection-v2 .feature-icon {
    color: #10b981;
    font-weight: bold;
    background: #d1fae5;
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.ps-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.ps-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.info-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-weight: 600;
}

.info-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
}

.ps-cta-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 0.5rem;
}

.online-cta {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.offline-cta {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.ps-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    color: white;
}

/* === Trust Indicators === */
.ps-trust {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.trust-item {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* === Responsive === */
@media (max-width: 768px) {
    .ps-cards-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
    
    .ps-card-wrapper {
        height: 420px;
    }
    
    .ps-card.is-open {
        width: 95vw !important;
        max-height: 95vh !important;
        border-radius: 16px;
    }
    
    .ps-details-scroll {
        padding: 1rem;
    }
    
    .ps-features {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .ps-description {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
}

/* ===================================
   DARK MODE SUPPORT
   =================================== */

/* Main Container */
[data-theme="dark"] .path-selection-v2 {
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0.05) 0%, 
        var(--pinkcode-bg-body, #0f0f1a) 50%, 
        rgba(16, 185, 129, 0.05) 100%);
}

/* Header */
[data-theme="dark"] .ps-title {
    color: var(--pinkcode-text-primary, #f9fafb);
}

[data-theme="dark"] .ps-subtitle {
    color: var(--pinkcode-text-secondary, #9ca3af);
}

/* Backdrop */
[data-theme="dark"] .ps-backdrop {
    background: rgba(0, 0, 0, 0.8);
}

/* Card Faces */
[data-theme="dark"] .ps-card-front,
[data-theme="dark"] .ps-card-back {
    background: var(--pinkcode-bg-card, #1e1e2e);
    border-color: var(--pinkcode-border-color, rgba(255, 255, 255, 0.1));
}

/* Card Content */
[data-theme="dark"] .ps-card-title {
    color: var(--pinkcode-text-primary, #f9fafb);
}

[data-theme="dark"] .ps-card-tagline {
    color: var(--pinkcode-text-secondary, #9ca3af);
}

[data-theme="dark"] .path-selection-v2 .price-value {
    color: var(--pinkcode-text-primary, #f9fafb);
}

[data-theme="dark"] .path-selection-v2 .price-period {
    color: var(--pinkcode-text-secondary, #9ca3af);
}

/* Expand Button */
[data-theme="dark"] .ps-expand-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--pinkcode-border-color, rgba(255, 255, 255, 0.1));
    color: var(--pinkcode-text-secondary, #9ca3af);
}

[data-theme="dark"] .ps-expand-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--pinkcode-text-primary, #f9fafb);
}

/* Back Header */
[data-theme="dark"] .ps-back-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: var(--pinkcode-border-color, rgba(255, 255, 255, 0.1));
}

[data-theme="dark"] .ps-back-title {
    color: var(--pinkcode-text-primary, #f9fafb);
}

[data-theme="dark"] .ps-close-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--pinkcode-text-secondary, #9ca3af);
}

[data-theme="dark"] .ps-close-btn:hover {
    background: #ef4444;
    color: white;
}

/* Details Content */
[data-theme="dark"] .ps-description {
    color: var(--pinkcode-text-secondary, #d1d5db);
}

/* Features Section */
[data-theme="dark"] .ps-features {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .ps-feature {
    color: var(--pinkcode-text-secondary, #d1d5db);
}

[data-theme="dark"] .path-selection-v2 .feature-icon {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

/* Info Grid */
[data-theme="dark"] .ps-info-grid {
    border-top-color: var(--pinkcode-border-color, rgba(255, 255, 255, 0.1));
}

[data-theme="dark"] .info-label {
    color: var(--pinkcode-text-secondary, #9ca3af);
}

[data-theme="dark"] .info-value {
    color: var(--pinkcode-text-primary, #f9fafb);
}

/* Trust Section */
[data-theme="dark"] .ps-trust {
    border-top-color: var(--pinkcode-border-color, rgba(255, 255, 255, 0.1));
}

[data-theme="dark"] .trust-item {
    color: var(--pinkcode-text-secondary, #9ca3af);
}
