/* CSS Variables for Easy Customization */
:root {
    /* Font Families */
    --font-primary: 'Jost', sans-serif;
    --font-secondary: 'Arial', sans-serif;

    /* Color Palette */
    --color-background: #272727;
    --color-text: #ffffff;
    --color-primary: #ff2727;
    --color-secondary: #007cba;
    --color-accent: #f0f0f0;
    --color-header-footer-bg: #272727;
    --color-header-footer-text: #ffffff;
    --color-toggle-button: #ffffff;
    --color-scroll-top-bg: #007cba;
    --color-scroll-top-text: #ffffff;

    /* Transition Settings */
    --transition-speed: 0.3s;

    /* Highlight Color Variable */
    --highlight-color-light: red; /* For Light Mode */
    --highlight-color-dark: #FF0000; /* Bright red for Dark Mode */
    --highlight-color: var(--highlight-color-light);
}

/* Light Mode Overrides */
body.light-mode {
    --color-background: #ffffff;
    --color-text: #000000;
    --color-header-footer-bg: #f1f1f1;
    --color-header-footer-text: #000000;
    --color-toggle-button: #000000;
    --color-scroll-top-bg: #005a87;
    --color-scroll-top-text: #ffffff;
    --highlight-color: var(--highlight-color-light);
}

body.dark-mode {
    --highlight-color: var(--highlight-color-dark);
}

body.light-mode nav a,
body.light-mode .footer-section ul li a {
    color: #FF2727;
}

body.light-mode .artist {
    background: #f9f9f9;
    color: #000000;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

body.light-mode .artist img {
    background-color: #ffffff;
}

body.light-mode .artist h2 {
    color: #000000;
}

body.light-mode .artist p {
    color: #333333;
}

body.light-mode .artist ul li a {
    color: #000000;
}

body.light-mode .artist ul li a:hover {
    color: #007cba;
}

body.light-mode .search-bar input {
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #ccc;
}

body.light-mode .search-bar button {
    background-color: #005a87;
}

body.light-mode .search-bar button:hover {
    background-color: #003f5c;
}

body.light-mode .toggle-button:hover {
    color: #ffcc00;
}

body.light-mode main nav a { 
    color: #000000; 
}

/* General Styles */
body {
    margin: 0;
    font-family: var(--font-primary);
    background-color: var(--color-background);
    color: var(--color-text);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

header, footer {
    background-color: var(--color-header-footer-bg);
    padding: 15px 10%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
    transition: background-color var(--transition-speed);
}

.header-left, .footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo, .footer-logo {
    width: 100px;
    height: auto;
}

.site-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-header-footer-text);
    margin: 0;
}

.site-tagline {
    font-size: 0.8rem;
    color: #B7B7B7;
    margin: 0;
}

nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

nav a, .footer-section ul li a {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    transition: color var(--transition-speed);
}

nav a:hover, .footer-section ul li a:hover { 
    text-decoration: underline; 
}

/* Navigation Menu Styles */
.nav-menu {
    display: none; /* Hidden by default for mobile */
    position: absolute;
    top: 60px;
    left: 10%;
    background-color: var(--color-header-footer-bg);
    width: 80%;
    max-width: 300px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    z-index: 1000; /* High z-index to appear above other elements */
}

.nav-menu.active {
    display: block;
}

.nav-menu ul {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--color-primary);
    cursor: pointer;
}

.nav-menu a:hover {
    background-color: rgba(255, 39, 39, 0.1);
}

.has-submenu > a::after {
    content: '';
    float: right;
}

.has-submenu.active > a::after {
    content: '';
}

.submenu {
    display: none; /* Hidden by default */
    list-style: none;
    padding-left: 20px;
    position: relative;
    z-index: 1000; /* Ensure submenus appear above other content */
    background-color: var(--color-header-footer-bg);
}

.has-submenu.active > .submenu {
    display: block; /* Show when active */
}

/* Header Right (Search and Toggle) */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-toggle-button);
    transition: color var(--transition-speed);
}

.toggle-button:hover {
    color: var(--color-primary);
}

.search-bar {
    display: flex;
    align-items: center;
}

.search-bar input {
    padding: 5px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #333;
    color: var(--color-text);
    outline: none;
    margin-right: 5px;
}

.search-bar button {
    padding: 5px 10px;
    border: none;
    background-color: var(--color-secondary);
    color: var(--color-scroll-top-text);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.search-bar button:hover {
    background-color: #005a87;
}

/* Main Content Styles */
main {
    padding: 30px;
    text-align: center;
    position: relative;
    z-index: 1;
}

main h1, main p {
    margin-bottom: 20px;
}

main nav {
    display: flex;
    justify-content: center;
    gap: 15px; /* Spacing between the links */
    margin-top: 20px; /* Space between the paragraph and navigation */
}

main nav a { 
    color: var(--color-text); 
    text-decoration: none; 
    font-size: 1rem; 
    font-weight: bold; 
    padding: 5px 10px; /* Add some padding for better clickability */ 
    transition: color var(--transition-speed);
}

main nav a:hover { 
    text-decoration: underline; /* Adds underline effect on hover */ 
}

/* Highlight Text in Red */
.highlight-text {
    color: var(--highlight-color);
}

/* Artist Card Styles */
.artists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Responsive columns */
    gap: 30px; /* Uniform gap between rows and columns */
    justify-content: center;
}

.artist { 
    display: flex; 
    flex-direction: column; 
    align-items: center; /* Center items horizontally */
    background: var(--color-background);
    padding: 20px; 
    border-radius: 8px; 
    width: 100%; 
    max-width: 320px; 
    text-align: center; 
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3); 
    position: relative; 
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.artist img { 
    width: 120px; /* Adjusted size */
    height: 120px; /* Ensures a square image */
    object-fit: cover; /* Ensures the image covers the container */
    border-radius: 50%; 
    margin-bottom: 15px; 
    background-color: var(--color-background);
    padding: 5px; /* Optional: Adds padding around the image */
}

.artist h2 { 
    font-size: 1.2em; 
    margin: 0 0 10px 0; /* Reduced top margin */
    color: var(--color-text);
}

.artist p { 
    font-size: 0.9em; 
    color: var(--color-text); 
    margin: 10px 0 15px 0; /* Added bottom margin */
    text-align: justify; 
    flex-grow: 1; 
}

.artist ul { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}

.artist ul li { 
    margin: 5px 0; 
}

.artist ul li a { 
    color: var(--color-accent); 
    font-weight: bold; 
    text-decoration: none; 
}

.artist ul li a:hover { 
    text-decoration: underline; 
}

body.light-mode .artist ul li a:hover { 
    color: var(--color-secondary); 
}

/* Footer-specific Styling */ 
.footer-section ul { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}

.footer-section ul li { 
    margin-bottom: 5px; 
}

/* Scroll to Top Button Styling */
#scroll-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background-color: var(--color-scroll-top-bg);
    color: var(--color-scroll-top-text);
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: none; /* Hidden by default */
    z-index: 1001; /* Above nav-menu */
    transition: background-color var(--transition-speed), transform var(--transition-speed);
}

#scroll-to-top:hover {
    background-color: #005a87; /* Darkened by 10% */
    transform: scale(1.1);
}

body.light-mode #scroll-to-top:hover {
    background-color: #003f5c; /* Darkened by 20% */
}

/* Responsive Navigation Menu */
@media (max-width: 768px) {
    .nav-menu {
        display: none; /* Hidden by default on mobile */
        flex-direction: column;
    }

    .nav-menu.active {
        display: block;
    }

    .hamburger {
        display: block;
        background: none;
        border: none;
        font-size: 2rem;
        cursor: pointer;
        color: var(--color-text);
        transition: color var(--transition-speed);
    }

    .toggle-button {
        font-size: 1.2rem;
    }

    /* Submenu Styling */
    .has-submenu > a::after {
        content: ' ';
        float: right;
    }

    .has-submenu.active > a::after {
        content: '';
    }

    .submenu {
        display: none; /* Hidden by default */
        flex-direction: column;
    }

    .has-submenu.active > .submenu {
        display: block;
    }

    /* Adjusting Submenu Indentation */
    .submenu .submenu {
        padding-left: 20px;
    }
}

@media (min-width: 769px) {
    .hamburger {
        display: none;
    }

    .nav-menu {
        display: block !important;
        position: static;
        box-shadow: none;
        border-radius: 0;
        width: auto;
        z-index: 1000;
    }

    .nav-menu ul {
        display: flex;
    }

    .nav-menu li {
        position: relative;
    }

    /* Positioning Submenu */
    .submenu {
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--color-header-footer-bg);
        box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
        border-radius: 8px;
        min-width: 150px;
        display: none; /* Ensure submenus are hidden by default */
        z-index: 1000;
    }

    .submenu li a {
        padding: 10px 20px;
    }

    .submenu .submenu {
        left: 100%;
        top: 0;
    }

    /* Ensure submenus appear only when active, not on hover */
    .has-submenu.active > .submenu {
        display: block;
    }
}


/* Focus Styles for Accessibility */
.nav-menu a:focus,
.toggle-button:focus,
.hamburger:focus,
.search-bar button:focus {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* Navbar container */
.navbar {
    overflow: hidden;
    background-color: #333;
    font-family: Arial, sans-serif;
}

/* Links inside the navbar */
.navbar a {
    float: left;
    font-size: 16px;
    color: white;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}

/* The dropdown container */
.dropdown {
    float: left;
    overflow: hidden;
}

/* Dropdown button */
.dropdown .dropbtn {
    font-size: 16px;
    border: none;
    outline: none;
    color: white;
    padding: 14px 16px;
    background-color: inherit;
    font-family: inherit;
    margin: 0;
}

/* Add a background color to navbar links on hover */
.navbar a:hover, .dropdown:hover .dropbtn {
    background-color: red;
}

/* Dropdown content (hidden by default) */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
}

/* Links inside the dropdown */
.dropdown-content a {
    float: none;
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

/* Add a background color to dropdown links on hover */
.dropdown-content a:hover {
    background-color: #ddd;
}

/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Prevent Background Scroll When Menu is Open */
.no-scroll {
    overflow: hidden;
}
/* Hide the checkbox */
.dropdown-checkbox {
    display: none;
}

/* Style the dropdown label */
.dropdown-label {
    display: block;
    padding: 10px 20px;
    color: var(--color-primary);
    cursor: pointer;
    position: relative;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.dropdown-label:hover {
    background-color: rgba(255, 39, 39, 0.1);
}

/* Dropdown arrow rotation when active */
.dropdown-checkbox:checked + .dropdown-label::after {
    transform: rotate(180deg);
}

/* Add transition for the arrow */
.dropdown-label::after {
    content: '';
    position: absolute;
    right: 20px;
    transition: transform var(--transition-speed);
}

/* Style the submenu */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-speed) ease-out;
    background-color: var(--color-header-footer-bg);
    padding-left: 20px;
}

/* Show submenu when checkbox is checked */
.dropdown-checkbox:checked ~ .submenu {
    max-height: 500px; /* Adjust as needed to accommodate submenu items */
    transition: max-height var(--transition-speed) ease-in;
}

/* Style submenu links */
.submenu a {
    display: block;
    padding: 10px 0;
    color: var(--color-text);
    text-decoration: none;
    transition: color var(--transition-speed), background-color var(--transition-speed);
}

.submenu a:hover {
    background-color: var(--color-secondary);
    color: var(--color-header-footer-text);
}
