/* style.css */

/* --- General Styles (Apply to all elements unless overridden by IDs) --- */

body {
    font-family: 'Source Sans Pro', Arial, sans-serif;
    background-color: #f4f4f4; /* A neutral background for the page */
    margin: 0; /* Remove default body margin */
    padding: 20px; /* Add some padding around the container */
}

.container {
    max-width: 800px;
    margin: 30px auto; /* Centers the container and adds vertical margin */
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* --- General Styles for the Dynamic Index/Menu Container (.color-index) --- */
.color-index {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.color-index h2 {
    text-align: center;
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
}

/*
    *** MODIFIED SECTION FOR BLACK DOTS ***
    This section is updated to ensure list-style: none; is applied
    with higher specificity and !important to override conflicting rules.
*/
/* Remove bullet points from color index lists */
#color-group-index ul,
#color-abc-index ul, /* Targets the UL within the A-Z index container */
.color-index ul {
    list-style: none !important; /* Forces removal of bullet points */
    padding: 0;      /* Removes default left padding from the list */
    margin: 0;       /* Removes default top/bottom margin from the list */
    /* Original grid properties are still here for .color-index ul unless overridden by specific IDs */
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Exactly 4 equally sized columns */
    gap: 10px 20px; /* Maintain the gap */
}

/* Ensure list items within index also have no list style */
#color-group-index ul li,
#color-abc-index ul li, /* Targets LI within the A-Z index container */
.color-index li {
    list-style-type: none; /* Explicitly ensure no bullet point on list items */
    margin: 0;
    text-align: center;
}
/* *** END MODIFIED SECTION *** */


/* --- Base styles for index BUTTONS (will be overridden by specific IDs for colors) --- */
.color-index button {
    text-decoration: none; /* No underline */
    font-weight: normal;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    display: block; /* Make buttons fill their parent li */
    width: 100%;    /* Make buttons take 100% of their parent li */
    box-sizing: border-box; /* Include padding/border in width calculation */
    cursor: pointer; /* Ensure cursor is a pointer */
    font-size: 16px; /* Ensure font size is consistent */
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden; /* Hide overflow content */
    text-overflow: ellipsis; /* Add ellipsis for overflowed text */
    /* Remove specific color/border/padding here, as they'll come from IDs below */
}

/* --- General Styles for the Main Button Container (.button-container) --- */
.button-container {
    display: grid;
    gap: 20px;
}

/* Rule to make H2 headings within main button containers span the full width */
.button-container h2 {
    grid-column: 1 / -1; /* Forces H2 to span all grid columns */
    text-align: center;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #333;
}

/* --- General Button Styles (Apply to all color buttons unless overridden) --- */
button {
    padding: 15px 20px; /* Default padding for main color buttons */
    border: none;
    border-radius: 5px; /* Rounded corners for buttons */
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Subtle shadow for depth */
    box-sizing: border-box; /* Ensures padding and border are included in the element's total width */
}

.toggle-button {
    margin-bottom: 10px;
}

/* --- Specific Styles by ID --- */

/* Styles for the ABC file's menu buttons ('A', 'B', 'C' etc.) */
#color-abc-index ul {
    grid-template-columns: repeat(12, 1fr); /* 12 columns for ABC index buttons */
    gap: 5px; /* Adjust gap for more columns if needed */
}

#color-abc-index ul li button {
    padding: 10px 5px; /* Original specific padding, adjust if needed for 12 columns */
    color: #007bff; /* Re-added original color */
    border: 1px solid #007bff; /* Re-added original border */
    background-color: transparent; /* Ensure no default button background */
}
#color-abc-index ul li button:hover { /* Hover state */
    background-color: #007bff; /* Original hover background */
    color: white; /* Original hover color */
    border-color: #0056b3; /* Original hover border */
}


/* Styles for the GROUP file's menu buttons ('Blues', 'Reds' etc.) */
#color-group-index ul li button {
    padding: 10px 15px; /* Original specific padding */
    color: #007bff; /* Re-added original color */
    border: 1px solid #007bff; /* Re-added original border */
    background-color: transparent; /* Ensure no default button background */
}
#color-group-index ul li button:hover { /* Hover state */
    background-color: #007bff; /* Original hover background */
    color: white; /* Original hover color */
    border-color: #0056b3; /* Original hover border */
}

/* Specific grid for the ABC file's main color buttons */
#main-abc-buttons {
    grid-template-columns: repeat(3, 1fr); /* 4 columns for ABC's main buttons */
}

/* Specific grid for the GROUP file's main color buttons */
#main-group-buttons {
    grid-template-columns: repeat(3, 1fr); /* 4 equally sized columns for Group's main buttons */
}

/* Ensure buttons within #main-group-buttons explicitly fill their grid cell uniformly */
#main-group-buttons button {
    display: block;
    width: 100%;
}

/* Ensure buttons within #main-abc-buttons explicitly fill their grid cell uniformly */
#main-abc-buttons button {
    display: block;
    width: 100%;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    body {
        padding: 5px; /* Further reduce overall padding on smaller screens */
    }

    .container {
        margin: 10px auto; /* Further reduce vertical margin for container */
        padding: 15px; /* Adjust container padding */
    }

    .color-index {
        padding: 10px; /* Reduced padding for the color index container itself */
    }
    .color-index ul {
        box-sizing: border-box; /* Ensure box-sizing on the grid container */
    }

    /* Adjust ABC index buttons for smaller screens */
    #color-abc-index ul {
        grid-template-columns: repeat(6, 1fr); /* 6 columns on smaller screens */
        gap: 2px; /* Adjusted gap for ABC index */
    }

    #color-abc-index ul li button {
        font-size: 13px; /* Slightly smaller font for ABC index buttons */
        padding: 7px 2px; /* Smaller padding */
    }

    /* Adjust Group index buttons for smaller screens to be a single column */
    .color-index ul {
        grid-template-columns: 1fr; /* Changed to single column */
        gap: 8px; /* Adjusted gap for single column */
    }

    .color-index ul li button {
        font-size: 14px; /* Maintain readable font size */
        padding: 10px 5px; /* Adjust padding for single column */
    }

    /* Main color buttons should be one column on mobile */
    #main-abc-buttons,
    #main-group-buttons {
        grid-template-columns: 1fr; /* Single column layout for main buttons */
        gap: 10px; /* Reduce gap between stacked buttons */
    }

    button {
        padding: 12px 15px; /* Increase padding for better tap target */
        font-size: 18px; /* Larger font size for readability */
    }
}

@media (max-width: 480px) {
    /* Further adjust ABC index buttons for very small screens */
    #color-abc-index ul {
        grid-template-columns: repeat(4, 1fr); /* 4 columns on very small screens */
    }
}

/* Scroll-to-Top Button Styles */
.scroll-to-top {
    display: none; /* Hidden by default, JavaScript will show it */
    position: fixed; /* Fixed/sticky position */
    bottom: 20px; /* Place the button at the bottom of the page */
    right: 20px; /* Place the button at the right */
    z-index: 99; /* Make sure it does not overlap */
    border: none; /* Remove borders */
    outline: none; /* Remove outline */
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
    color: white; /* Text color */
    cursor: pointer; /* Add a mouse pointer on hover */
    padding: 15px; /* Some padding */
    border-radius: 10px; /* Rounded corners */
    font-size: 20px; /* Increase font size */
    opacity: 0.8; /* Slightly less opaque to start */
    transition: opacity 0.3s ease, background-color 0.3s ease; /* Smooth transition for hover effects */
}

.scroll-to-top:hover {
    background-color: rgba(0, 0, 0, 0.7); /* Darker on hover */
    opacity: 1; /* Fully opaque on hover */
}