.pricing-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
    padding: 0 15px;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
    flex-wrap: wrap;
    align-items: stretch;
    min-height: auto;
    overflow: visible;
}

.pricing-card {
    flex: 1 1 calc(25% - 15px);
    min-width: 250px;
    max-width: 280px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-bottom: 20px;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

.pricing-card.most-popular {
    border: 2px solid #ffd700;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.pricing-card .icon {
    font-size: 48px;
    color: black;
    margin-bottom: 20px;
}

.pricing-card h3 {
    font-size: 24px;
    margin-bottom: 15px;
    word-wrap: break-word;
    line-height: 1.3;
}

.pricing-card p {
    color: #6c757d;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.4;
    flex-grow: 1;
}

.pricing-card .price {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 15px;
    word-wrap: break-word;
}

.pricing-card .package_price {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
    word-wrap: break-word;
    color: #333;
}

.pricing-card .price-description {
    color: #6c757d;
    margin-bottom: 20px;
}

.pricing-card ul {
    list-style-type: none;
    padding: 0;
    margin-bottom: 25px;
    text-align: left;
    flex-grow: 1;
}

.pricing-card ul li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 25px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.pricing-card ul li:before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.btn {
    display: block;
    padding: 12px 15px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
}

.btn-primary {
    background-color: black;
    color: #ffffff;
    margin-top: auto;
    width: 100%;
    max-width: 100%;
    padding: 12px 15px;
    font-size: 14px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.btn-primary:hover {
    background-color: #333;
    color: white;
    text-decoration: none;
}

/* Ensure all buttons in pricing cards stay within bounds */
.pricing-card button,
.pricing-card .btn,
.pricing-card a.btn {
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Special handling for form buttons in pricing cards */
.pricing-card form {
    width: 100%;
    margin-top: auto;
}

.pricing-card form button {
    width: 100%;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-outline-primary {
    background-color: transparent;
    color: black;
    border: 1px solid black;
}

.btn-outline-primary:hover {
    background-color: black;
    color: #ffffff;
}

/* Global Mobile Scroll Fix */
@media screen and (max-width: 768px) {
    html {
        overflow-x: hidden;
        overflow-y: auto;
        height: auto;
        min-height: 100%;
    }

    body {
        overflow-x: hidden;
        overflow-y: auto;
        position: relative;
        min-height: 100vh;
        padding-bottom: 100px; /* Ensure scroll space at bottom */
    }
}

/* Counter Container Styling for Page Package */
.counter-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

.counter-container button {
    font-size: 1.1rem;
    padding: 8px 12px;
    cursor: pointer;
    border: none;
    background-color: black;
    color: white;
    border-radius: 5px;
    min-width: 35px;
    width: auto;
    max-width: none;
    box-sizing: border-box;
    flex-shrink: 0;
}

.counter-container button:hover {
    background-color: #333;
}

.counter-container .count {
    font-size: 1.2rem;
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    padding: 8px 5px;
    border-radius: 3px;
    background-color: #f8f9fa;
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
    .pricing-container {
        padding: 0 10px;
        gap: 10px;
    }

    .pricing-card {
        min-width: 240px;
        padding: 18px 12px;
    }
}

@media screen and (max-width: 1000px) {
    .pricing-card {
        flex: 1 1 calc(50% - 10px);
        max-width: none;
    }
}

@media screen and (max-width: 768px) {
    .pricing-container {
        gap: 15px;
    }

    .pricing-card {
        flex: 1 1 calc(50% - 8px);
        min-width: 220px;
        padding: 15px 10px;
    }

    .pricing-card .price {
        font-size: 24px;
    }

    .pricing-card h3 {
        font-size: 20px;
    }

    .pricing-card .btn,
    .pricing-card button {
        padding: 10px 8px;
        font-size: 13px;
    }
}

@media screen and (max-width: 540px) {
    .pricing-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 0 15px 100px 15px; /* Add more bottom padding for scroll space */
        margin-bottom: 100px; /* Ensure more space at bottom */
    }

    .pricing-card {
        flex: none;
        width: 100%;
        max-width: 350px;
        min-width: auto;
        margin-bottom: 20px;
        position: relative;
        z-index: 1;
    }

    /* Add specific margin to last card */
    .pricing-card:last-child {
        margin-bottom: 150px; /* Extra space for last card */
        padding-bottom: 20px;
    }

    /* Ensure the main content block allows scrolling */
    .hero {
        margin-bottom: 20px;
    }

    /* Ensure cancel subscription section doesn't interfere */
    .cancel-subscription-container,
    .change-subscription-info-container {
        margin-top: 50px;
        margin-bottom: 50px;
    }
}


.cancel-subscription-container {
    display: flex;
    justify-content: center;
    margin-top: 3vh;
}

.cancel-subscription-btn {
    background-color: white;
    color: black;
    border: 1px solid black;
    font-size: 14px;
    padding: 10px 20px;
    font-weight: 500;
}

.cancel-subscription-btn:hover {
    background-color: #F6F5F4;
    color: black;
}

.change-subscription-info {
    margin-top: 10px;
    font-size: 12px;
    color: #6c757d;
}

.change-subscription-info-container {
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
    text-align: center;
}

.current-plan {
    font-size: 12px;
    margin-bottom: -10px;
    font-weight: 1000px;
}

/* Messages Container */
.messages-container {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    z-index: 1000;
}

/* Default Alert Styling */
.alert {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease-in-out;
}

/* Success Message */
.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 5px solid #28a745;
}

/* Error Message */
.alert-error, .alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 5px solid #dc3545;
}

/* Warning Message */
.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 5px solid #ffc107;
}

/* Info Message */
.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 5px solid #17a2b8;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auto-dismiss messages after 5 seconds */
.alert {
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.alert.fade-out {
    opacity: 0;
}
