/* Global Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Light Mode Variables (default) */
:root {
    --color-primary: #0056b3;
    --color-secondary: #6c757d;
    --color-accent: #28a745;
    --color-background: #f8f9fa;
    --color-text: #333;
    --color-success: #28a745;
    --color-warning: #ffc107;
}

/* Dark Mode Variables */
body.dark-mode {
    --color-primary: #1a73e8;
    --color-secondary: #3c4043;
    --color-accent: #34a853;
    --color-background: #202124;
    --color-text: #e8eaed;
    --color-success: #34a853;
    --color-warning: #fbbc05;
}

/* Dark mode checklist container and items */
body.dark-mode .checklist {
    background-color: #303134; /* Darker background for the checklist */
    color: var(--color-text);
}

body.dark-mode .checklist-item {
    background-color: #3c4043; /* Darker background for checklist items */
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

body.dark-mode .checklist-item:hover {
    background-color: #5f6368; /* Slightly lighter hover color for dark mode */
}

/* Dark Mode Toggle Button */
#dark-mode-toggle {
    background-color: var(--color-secondary);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#dark-mode-toggle:hover {
    background-color: var(--color-accent);
}

/* Apply the variables */
body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
    margin: 0;
    padding: 0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    overflow: hidden; /* Prevents overflow if any child exceeds width */
}

header {
    background-color: var(--color-primary);
    color: white;
    text-align: center;
    padding: 1rem 0;
}

h1 {
    margin: 0;
}

h2 {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 5px;
    margin-top: 30px;
}

.site-name {
    font-size: 2rem;
    font-weight: bold;
    color: #26ca4c;
    text-decoration: none;
    margin-bottom: 5px;
}

/* Top Navigation Styles */
.top-nav {
    background-color: var(--color-primary);
    padding: 10px 0;
}

.top-nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.top-nav ul li {
    margin: 0 10px;
}

.top-nav ul li a,
.top-nav ul li button {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    padding: 8px 12px; /* Reduced padding */
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.top-nav ul li a:hover,
.top-nav ul li button:hover {
    background-color: var(--color-accent);
}

/* Adjustments for Smaller Screens */
@media (max-width: 480px) {
    .top-nav ul li {
        margin: 0 5px; /* Reduced margin */
    }

    .top-nav ul li a,
    .top-nav ul li button {
        font-size: 0.9rem; /* Slightly smaller font size */
        padding: 6px 8px;  /* Further reduced padding */
    }
}

/* Ad Banner Styles */
.ad-banner {
    width: 100%;
    max-width: 728px;
    height: auto;
    margin: 20px auto;
    background-color: var(--color-secondary);
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .ad-banner {
        max-width: 100%;
        height: auto;
        font-size: 0.7rem;
    }
}

/* How to Use Section */
.how-to-use {
    margin-top: 20px;
    background-color: var(--color-background);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.how-to-use h2 {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 10px;
}

.how-to-use p {
    font-size: 1rem;
    color: var(--color-text);
}

.how-to-use strong {
    color: var(--color-accent);
}

/* Search Box Styles */
#search-box {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px;
    margin: 20px 0;
    border: 1px solid var(--color-secondary);
    border-radius: 4px;
    font-size: 1rem;
}

/* Adjust font size on smaller screens */
@media (max-width: 480px) {
    #search-box {
        font-size: 0.9rem;
    }
}

/* Search Info Styling */
.search-info {
    margin: 10px 0;
    background-color: #e3f2fd; /* Light blue background for light mode */
    padding: 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    color: var(--color-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #90caf9; /* Subtle border for a cleaner look */
}

/* Button inside the search info */
.search-info button {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.3s ease;
}

.search-info button:hover {
    background-color: var(--color-accent);
}

/* Dark Mode Overrides */
body.dark-mode .search-info {
    background-color: #1e88e5; /* Deeper blue background for dark mode */
    color: var(--color-text);
    border: 1px solid #1976d2; /* Border with a darker shade of blue */
}

body.dark-mode .search-info button {
    background-color: var(--color-accent); /* Changed to accent color for better contrast */
    color: white;
}

body.dark-mode .search-info button:hover {
    background-color: #2e7d32; /* Darker shade of the accent color on hover */
}

/* Controls Section */
.controls {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap; /* Allows buttons to wrap on smaller screens */
    margin-bottom: 20px;
}

.controls button {
    flex: 1 1 auto;
    margin: 5px;
    background-color: var(--color-accent);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.controls button:hover {
    background-color: var(--color-primary);
}

/* Responsive Controls */
@media (max-width: 600px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .controls button {
        width: 100%;
        margin: 5px 0;
    }
}

/* Checklist Styles */
.checklist {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
}

.checklist-section {
    margin-bottom: 20px;
}

.checklist-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background-color: var(--color-background);
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.checklist-item:hover {
    background-color: #e9ecef;
}

.checklist-item input[type="checkbox"] {
    margin-right: 10px;
}

/* Progress Bar Styles */
.progress-container {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    width: 0;
    height: 20px;
    background-color: var(--color-success);
    transition: width 0.5s ease-in-out;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-weight: bold;
}

/* Quick Win Label */
.quick-win {
    background-color: var(--color-accent);
    color: white;
    padding: 2px 6px;
    font-size: 0.75rem;
    border-radius: 4px;
    margin-left: 10px;
    font-weight: bold;
}

/* Back to Top Link */
.back-to-top {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--color-accent);
    text-decoration: none;
}

.back-to-top:hover {
    text-decoration: underline;
}

/* Recommendations Section */
#recommendations {
    margin-top: 30px;
    background-color: var(--color-accent);
    color: white;
    padding: 15px;
    border-radius: 4px;
}

#recommendations h2 {
    margin-top: 0;
    color: white;
    border-bottom: none;
}

/* Cookie Banner */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--color-warning);
    color: var(--color-text);
    text-align: center;
    padding: 10px;
}

#cookie-accept {
    background-color: var(--color-success);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* Footer Styles */
.footer {
    background-color: var(--color-secondary);
    color: white;
    text-align: center;
    padding: 15px 0;
    position: relative;
    width: 100%;
    bottom: 0;
    margin-top: 30px;
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* Responsive Footer (Optional) */
@media (max-width: 600px) {
    .footer {
        padding: 10px 0;
    }
}
