/* Pricing Section */
.pricing-section {
    padding: 8rem 2rem;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: transparent;
    overflow: hidden;
    z-index: 1;
}

/* Animated Gradient Mesh */
.pricing-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.12), transparent 50%),
        radial-gradient(circle at 0% 0%, rgba(6, 182, 212, 0.15), transparent 50%),
        radial-gradient(circle at 100% 0%, rgba(139, 92, 246, 0.1), transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(20, 184, 166, 0.1), transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(56, 189, 248, 0.08), transparent 50%);
    filter: blur(60px);
    z-index: -1;
    animation: meshRotate 30s linear infinite;
    transform-origin: center;
}

@keyframes meshRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Toggle Switch */
.pricing-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    font-weight: 500;
    color: var(--text-muted);
}

.pricing-toggle-container .toggle-label {
    transition: color 0.3s ease;
    cursor: pointer;
}

.pricing-toggle-container .toggle-label.active {
    color: var(--text-main);
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    transition: .4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 34px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 3px;
    background-color: var(--text-main);
    /* White dot in dark mode, black in light */
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent-glow);
    border-color: transparent;
}

input:checked+.slider:before {
    transform: translateX(26px);
    background-color: var(--bg-color);
    /* Contrast dot */
}

.badge-save {
    background: #10b981;
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-left: 0.5rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

/* Grid */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
    /* Align vertically */
}

.pricing-card {
    display: flex;
    flex-direction: column;
    padding: 3rem 2.5rem;
    position: relative;
    height: 100%;
}

/* Override glass-panel slightly for specific needs */
.pricing-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow:
        0 30px 60px -15px rgba(0, 0, 0, 0.1),
        0 0 30px rgba(59, 130, 246, 0.05);
}

/* Popular Card Highlighting */
.pricing-card.popular {
    border: none;
    background: var(--bg-color);
    box-shadow: 0 25px 50px -12px rgba(59, 130, 246, 0.25);
    transform: scale(1.08);
    z-index: 2;
    padding: calc(3rem - 2px) calc(2.5rem - 2px);
    position: relative;
    overflow: visible;
    /* To let the glowing border show */
}

/* Premium Gradient Border Effect */
.pricing-card.popular::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4, #8b5cf6, #3b82f6);
    background-size: 300% 300%;
    border-radius: 18px;
    z-index: -1;
    animation: borderRotate 6s linear infinite;
}

@keyframes borderRotate {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.pricing-card.popular:hover {
    transform: scale(1.1) translateY(-10px);
    box-shadow: 0 40px 80px -20px rgba(59, 130, 246, 0.4);
}

/* Popular Tag */
.popular-tag {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--accent-glow);
    color: var(--bg-color);
    /* Contrast text */
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

/* Header & Price */
.pricing-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--card-border);
}

.plan-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.pricing-card.popular .plan-name {
    color: var(--text-main);
    background: linear-gradient(to right, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    font-weight: 800;
}

.price {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    margin: 1rem 0;
    color: var(--text-main);
}

.price .period {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 5px;
}

.plan-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Features List */
.pricing-features {
    list-style: none;
    margin-bottom: 2.5rem;
    flex-grow: 1;
    /* Push button down */
}

.pricing-features li {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    /* items alignment */
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.check {
    color: var(--accent-glow);
    font-weight: bold;
    flex-shrink: 0;
}

/* Buttons */
.pricing-card .btn {
    margin-top: auto;
}


/* Animation for price change */
@keyframes popIn {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.price.animate {
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}