:root {
    /* Base Colors */
    --primary: #440080;    /* Deep Purple */
    --accent: #009595;     /* Teal/Cyan */
    --text: #333;          /* Dark text for light backgrounds */
    --light-text: #f7f7f7; /* Very light background for white text */
    --transition: 0.3s ease;

    /* Primary Shades (Purple) */
    --primary-light: #5B00AA; /* Slightly lighter primary for hover effects on primary elements */
    --primary-dark: #330060;  /* Darker primary for active states or hover backgrounds */
    --primary-border: #6F00CC; /* A specific shade for borders related to primary */
    --primary-bg-light: #F2EBFA; /* Very light purple for subtle backgrounds */

    /* Accent Shades (Teal/Cyan) */
    --accent-light: #00C7C7; /* Slightly lighter accent for hover effects on accent elements */
    --accent-dark: #007070;  /* Darker accent for active states or hover backgrounds */
    --accent-border: #00AAAA; /* A specific shade for borders related to accent */
    --accent-bg-light: #EBF9F9; /* Very light teal for subtle backgrounds */

    /* Neutral Shades (for backgrounds, borders, general text) */
    --neutral-lightest: #FFFFFF; /* Pure white */
    --neutral-lighter: #F7F7F7;  /* Off-white background */
    --neutral-light: #ECECEC;    /* Light gray for tab backgrounds, etc. */
    --neutral-medium: #CCCCCC;   /* Medium gray for borders */
    --neutral-dark: #666;        /* Dark gray for descriptions */
    --neutral-darker: #333;      /* Even darker for main text */

    /* Badge Colors (keeping these distinct for semantic meaning) */
    --author-badge-color: #4CAF50;    /* Green */
    --traffic-badge-color: #FFC107;    /* Amber/Orange */
    --speed-badge-color: #2196F3;      /* Blue */
    --security-badge-color: #F44336;  /* Red */
    --analytics-badge-color: #9C27B0; /* Purple */
}

/* Main Container */
.infinite-pricing-container {
    background: var(--neutral-lighter);
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    margin: 2em auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Tabs */
.infinite-tabs {
    display: flex;
    background: var(--neutral-light);
    border-bottom: 1px solid var(--neutral-medium);
}
.tab-btn {
    padding: 1em 1.5em;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1em;
    font-weight: 600;
    color: var(--neutral-darker);
    cursor: pointer;
    transition: all var(--transition);
}
.tab-btn:hover {
    background: var(--neutral-medium);
}
.tab-btn.active {
    background: var(--neutral-lighter);
    border-bottom: 3px solid var(--primary);
    color: var(--primary);
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 1.5em;
    animation: fadeIn var(--transition);
}
.tab-content.active {
    display: block;
}

/* Headings */
.infinite-pricing-container h2 {
    font-size: 1.75em;
    color: var(--primary);
    margin-bottom: 0.5em;
}
.infinite-pricing-container h3 {
    font-size: 1.25em;
    margin-bottom: 0.75em;
    color: var(--neutral-darker);
}

/* Form Controls (Labels and Inputs) */
label {
    display: flex;
    align-items: center;
    padding: 0.75em;
    background: var(--neutral-lightest);
    border: 1px solid var(--neutral-medium);
    border-radius: 6px;
    margin-bottom: 0.75em;
    transition: all var(--transition);
}
label:hover {
    border-color: var(--primary);
}
input[type="radio"], input[type="checkbox"] {
    margin-right: 0.75em;
    accent-color: var(--primary);
    margin-top: 0.2em;
}

/* Specific input field styling */
.input-field {
    padding: 0.75em 1em;
    border: 1px solid var(--neutral-medium);
    border-radius: 6px;
    font-size: 1em;
    width: calc(100% - 2em); /* Adjust for padding */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    margin-top: 0.5em;
    margin-bottom: 1em;
}
.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-bg-light);
}


/* NEW: Page Selection Styles */
.page-count-input-group {
    margin-bottom: 1.5em; /* Space between manual input and scrollbox */
}

#extra-pages-manual-input {
    /* Apply existing input-field styles to manual input */
    padding: 0.75em 1em;
    border: 1px solid var(--neutral-medium);
    border-radius: 6px;
    font-size: 1em;
    max-width: 150px; /* Constrain width for number input */
    box-sizing: border-box;
    margin-top: 0.5em;
    display: block; /* Ensure it takes its own line */
}

#extra-pages-manual-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-bg-light);
}

.page-selection-container {
    margin-top: 1.5em;
    padding-top: 1em;
    border-top: 1px solid var(--neutral-medium); /* Separator line */
}

#extra-pages-scrollbox {
    max-height: 250px;
    overflow-y: auto; /* Enable scrolling */
    border: 1px solid var(--neutral-medium);
    border-radius: 8px;
    padding: 15px;
    background-color: var(--neutral-lightest);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05); /* Subtle inner shadow */
}

#extra-pages-scrollbox h4 {
    font-size: 1.05em;
    color: var(--primary-dark);
    margin-top: 1em;
    margin-bottom: 0.5em;
    border-bottom: 1px dashed var(--neutral-light); /* Subtle separator for categories */
    padding-bottom: 0.3em;
}

#extra-pages-scrollbox h4:first-child {
    margin-top: 0; /* No top margin for the very first h4 */
}

#extra-pages-scrollbox label {
    display: flex;
    align-items: center;
    background: none; /* No background for individual labels within scrollbox */
    border: none; /* No border for individual labels within scrollbox */
    padding: 0.2em 0; /* Reduced padding from 0.4em to 0.2em */
    margin-bottom: 0.1em; /* Reduced margin-bottom from 0.2em to 0.1em */
    cursor: pointer;
}

#extra-pages-scrollbox label:hover {
    color: var(--primary);
    background-color: var(--primary-bg-light); /* Highlight on hover */
    border-radius: 4px;
}

#extra-pages-scrollbox input[type="checkbox"] {
    margin-right: 0.8em;
    flex-shrink: 0;
}

/* Addon Items - REVISED FOR FLEXBOX */
.addon-item {
    display: flex;
    align-items: flex-start;
    position: relative;
    padding: 0.75em;
    background: var(--neutral-lightest);
    border: 1px solid var(--neutral-medium);
    border-radius: 6px;
    margin-bottom: 0.75em;
    transition: all var(--transition);
}

.addon-item > input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 0.2em;
    margin-right: 0.75em;
}

.addon-item > div { /* This is the div that wraps title, desc, and NEW badge container */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.addon-title {
    font-weight: 500;
    display: block;
    margin-bottom: 0.2em;
}
.addon-desc {
    color: var(--neutral-dark);
    font-size: 0.9em;
    font-style: italic;
    line-height: 1.4;
    margin-bottom: 0.5em;
}

/* NEW: Container for badges */
.addon-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-end; /* Pushes badges to the right */
    margin-top: auto; /* Pushes the badge container to the bottom if content is taller */
    padding-left: 10px; /* Small padding to prevent text from touching badges if it wraps */
}


/* Base Badge Styles - REVISED */
.addon-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--neutral-lightest); /* Default to white text for badges */
    z-index: 10;
    transition: all 0.3s ease; 
    flex-shrink: 0;
}

/* Individual Badge Colors - VERIFIED AND CORRECTED TEXT COLORS */
.author-badge { background-color: var(--author-badge-color); }
.traffic-badge {
    background-color: var(--traffic-badge-color);
    color: var(--neutral-lightest); /* Changed to white text for readability */
}
.speed-badge {
    background-color: var(--speed-badge-color);
    color: var(--neutral-lightest); /* Changed to white text for readability */
}
.security-badge { background-color: var(--security-badge-color); }
.analytics-badge { background-color: var(--analytics-badge-color); }

/* Sort Buttons Container */
.sort-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-bottom: 1em;
}

/* Sort Button Styles - VERIFIED BACKGROUND AND TEXT COLOR */
.sort-btn {
    padding: 0.6em 1em;
    background-color: var(--accent); /* Explicitly set to accent color */
    color: var(--neutral-lightest); /* Explicitly set to white text */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color var(--transition);
}
.sort-btn:hover {
    background-color: var(--accent-dark);
}


/* Summary Section */
.infinite-summary {
    background: var(--neutral-lightest);
    padding: 1.5em;
    border-radius: 8px;
    margin-top: 1.5em;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
#price-breakdown {
    list-style: none;
    padding: 0;
    margin: 1em 0;
}
#price-breakdown li {
    padding: 0.5em 0;
    border-bottom: 1px solid var(--neutral-lighter);
}
.infinite-total {
    margin-top: 1em;
    font-size: 1.4em;
    font-weight: 700;
    color: var(--primary);
}

/* Buttons */
#copy-quote {
    width: 100%;
    padding: 0.75em;
    background: var(--primary);
    color: var(--neutral-lightest);
    font-weight: 700;
    border: none;
    border-radius: 6px;
    margin-top: 1em;
    cursor: pointer;
    transition: all var(--transition);
}
#copy-quote:hover {
    background: var(--primary-dark);
}

/* Responsive */
@media (max-width: 768px) {
    .infinite-tabs {
        flex-wrap: wrap;
    }
    .tab-btn {
        padding: 0.75em;
        font-size: 0.9em;
    }
    .sort-buttons-container {
        flex-direction: column;
    }
    .addon-item {
        padding-right: 0.75em;
    }
}
.infinite-design label {
    display: block;
    margin-bottom: 10px;
}

.infinite-design .title {
    display: inline-block; /* stays next to checkbox */
    margin-left: 3px;
}

.infinite-design .desc {
    display: block; /* forces onto its own line */
    font-style: italic;
    color: var(--neutral-dark); /* Use variable for consistency */
    margin-left: 22px; /* optional: aligns under text instead of checkbox */
}

/* Additional style for italic descriptive text */
p.desc.italic {
    font-style: italic;
    color: var(--neutral-dark);
    font-size: 0.95em;
    margin-top: -0.5em; /* Pull it slightly closer to the heading */
    margin-bottom: 1em;
}