/* Base styles and box-sizing for all elements */
body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: #333; /* Default text color for package cards */
}

/* --- Animations --- */
@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Packages Section Styling --- */
.packages {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap to the next line */
    gap: 1.5rem; /* Adjusted gap for better spacing */
    justify-content: center; /* Center package cards */
    border-bottom: 5px solid #013153;
    overflow: hidden; /* Hide overflow during animations */
}

.packages-title {
    text-align: center;
    margin-bottom: 3rem; /* Adjusted margin */
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%; /* Ensure title takes full width */

    /* Initial state for JS animation */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.packages-title.is-in-view {
    opacity: 1;
    transform: translateY(0);
    animation: slideInUp 0.8s ease-out forwards;
}

.packages-title h2 {
    font-size: clamp(2rem, 5vw, 3.5rem); /* Fluid font size for main title */
    margin-bottom: 1rem;
}

.packages-sub-title {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem); /* Fluid font size for sub-title */
    line-height: 1.5;
    color: #fff;
    width: 60%; /* Occupy more width on larger screens */
    max-width: 800px; /* Prevent it from getting too wide */
}

/* Adjust margin for the second title (System Packages) */
#margin-top-adjust {
    margin-top: 5rem; /* More space between website and system packages sections */
}


/* Individual Package Card */
.package {
    background: #ffffffcc; /* Slightly transparent white */
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    padding: 30px;
    /* Use flex-basis for fluid width, allowing items to grow/shrink */
    flex: 1 1 300px; /* Allows cards to grow, min width 300px before wrapping */
    max-width: 350px; /* Max width for individual cards */
    position: relative;
    text-align: center;
    border: 2px solid #013153; /* Default border color */

    /* Animation and transition setup for scroll-in effect */
    opacity: 0;
    transform: translateY(50px);
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1),
                box-shadow 0.6s cubic-bezier(0.25, 1, 0.5, 1),
                opacity 0.6s ease-out; /* Add opacity transition for JS */
}

/* Class added by JavaScript to trigger animation */
.package.is-in-view {
    opacity: 1;
    transform: translateY(0);
    animation: slideInUp 0.8s ease-out forwards;
    /* Delay set via JS for staggering */
}

.package:hover {
    transform: scale(1.05); /* Slight zoom on hover */
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.package h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.8em); /* Fluid font size */
    margin-bottom: 10px;
    color: #013153; /* Darker heading color */
}

.price {
    font-size: clamp(1.8em, 4vw, 2.5em); /* Fluid font size for price */
    color: #333;
    margin: 10px 0;
    font-weight: bold;
}

.payment, .note {
    color: #777;
    margin-bottom: 20px;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.ul-adjust {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: left;
    margin-bottom: 20px; /* Space before the button */
}

.package ul {
    list-style: none;
    padding: 0;
    margin: 0; /* Remove default ul margin */
}

.package ul li {
    position: relative;
    margin: 10px 0;
    font-size: clamp(0.9em, 1.5vw, 1em); /* Fluid font size */
    padding-left: 1.5rem;
    color: #555; /* List item color */
}

.package ul li::before {
    content: '✔';
    position: absolute;
    left: 0;
    top: 0;
    color: #28a745; /* green checkmark */
    font-weight: bold;
}

/* Pro Package specific styling */
.pro {
    border: 2px solid #28a745; /* Green border for Pro */
}

.badge {
    position: absolute;
    top: -15px; /* Lift badge slightly higher */
    left: 50%;
    transform: translateX(-50%);
    background: #28a745;
    color: white;
    font-size: clamp(0.7em, 1.5vw, 0.9em); /* Fluid font size for badge */
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap; /* Prevent badge text from wrapping */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Buttons */
.package button, .package button-4 {
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: clamp(0.9rem, 1.8vw, 1.1rem); /* Fluid font size */
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease;
    width: 80%; /* Button takes most of the card width */
    max-width: 200px; /* Max width for button */
}

.package button:hover, .package button-4:hover {
    transform: translateY(-2px); /* Slight lift */
}

/* --- Media Queries for Responsiveness --- */

/* Tablet and Smaller Desktops (approx. 992px and below) */
@media (max-width: 992px) {
    .packages {
        padding: 3rem 1rem;
        gap: 1rem; /* Slightly reduced gap */
    }

    .packages-sub-title {
        width: 80%; /* Subtitle takes more width */
    }

    .package {
        flex: 1 1 45%; /* Two columns per row */
        max-width: 48%; /* Ensure it doesn't exceed half the width + gap */
        padding: 25px; /* Slightly less padding */
    }
}

/* Mobile Phones (approx. 768px and below) */
@media (max-width: 768px) {
    .packages {
        padding: 2rem 0.5rem;
    }

    .packages-sub-title {
        width: 95%; /* Subtitle takes almost full width */
        margin-bottom: 2rem;
    }

    .package {
        flex: 1 1 90%; /* Single column, taking most of the width */
        max-width: 400px; /* Max width for mobile cards */
        margin: 0.5rem 0; /* Adjust margin when stacked */
        padding: 20px; /* Reduced padding */
    }

    .package h3 {
        font-size: 1.4em; /* Fixed font size for small screens */
    }

    .price {
        font-size: 2em; /* Fixed font size for price */
    }

    .payment, .note {
        font-size: 0.85rem;
    }

    .package ul li {
        font-size: 0.9em;
    }

    .badge {
        font-size: 0.75em;
        padding: 5px 10px;
    }

    .package button, .package button-4 {
        width: 90%; /* Button takes more width */
        padding: 0.7rem 1rem;
        font-size: 1rem;
    }
}