/* Base Styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
  background-color: #f4f4f4; /* Default light mode */
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  width: 90%;
  margin: auto;
  padding: 20px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.header-left {
  display: flex; /* Align items horizontally */
  align-items: center; /* Center items vertically */
}

.logo {
  width: 50px;
  margin-right: 10px;
}

.logo-link {
  display: flex; /* Arrange image and text horizontally */
  align-items: center; /* Center items vertically */
  text-decoration: none; /* Remove underline */
  color: inherit; /* Inherit text color */
}

.logo-link span {
  font-size: 24px;
  font-weight: bold;
  margin-left: 10px; /* Space between the image and text */
}

.icon {
  width: 20px;
  height: 20px;
}

.header-right button {
  padding: 10px;
  border: none;
  border-radius: 5px;
  background-color: #000000; /* Add background for icons */
  cursor: pointer;
}

/* Welcome Page */
.welcome-popup {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9); /* Darker semi-transparent background */
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.welcome-popup-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  width: 90%; /* Responsive width */
  max-width: 500px; /* Same as other pop-ups */
}

.welcome-popup h2 {
  font-size: 28px;
  margin-bottom: 10px;
}

.welcome-popup p {
  font-size: 18px;
  margin-bottom: 20px;
  line-height: 1.5;
  color: #000;
}

.welcome-popup-link {
  text-decoration: underline;
  color: #000;
  cursor: pointer;
}

.welcome-popup-link:hover {
  color: #666;
}

.welcome-continue-btn {
  background-color: #000;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.welcome-continue-btn:hover {
  background-color: #666;
}

/* Search Bar */
#searchBar {
  width: 100%; /* Matches the width of the container */
  box-sizing: border-box; /* Ensures padding doesn't affect width */
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px; /* Rounded corners */
  background-color: #f8f8f8;
  margin-bottom: 20px;
}

#searchBar.dark-mode {
  background-color: #666; /* Matches the word list background */
  color: #FFF; /* Black text */
  border: 1px solid #000; /* Black border */
  border-radius: 8px; /* Keeps the rounded corners */
}

/* Placeholder Style in Regular Mode */
#searchBar::placeholder {
  color: #aaa; /* Default placeholder color */
}

/* Placeholder Style in Dark Mode */
body.dark-mode #searchBar::placeholder {
  color: #ddd; /* Lighter placeholder text for dark mode */
}

/* Word List */
.word-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid #ddd;
  border-radius: 8px; /* Rounded corners */
  background-color: white;
}

.word-list.dark-mode {
  background-color: #666; /* Gray background */
  border: 1px solid #000; /* Black border */
  color: #FFF; /* Black text */
}

.word-list li {
  padding: 15px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.word-list li:hover {
  background-color: #f0f0f0; /* Light gray on hover */
}

.word-list li.dark-mode:hover {
  background-color: #999999; /* Slightly lighter gray background */
  color: #000; /* Black text */
  border: 1px solid #000; /* Black border */
}

.word-list li:last-child {
  border-bottom: none;
}

/* General Pop-Up Styles */
.popup {
  display: none; /* Hidden by default */
  position: fixed;
  top: 50%; /* Center vertically */
  left: 50%; /* Center horizontally */
  transform: translate(-50%, -50%); /* Align center */
  background: rgba(255, 255, 255, 1); /* White background */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Subtle shadow for depth */
  z-index: 1000;
  width: 500px; /* Fixed width */
  padding: 20px;
  border-radius: 8px; /* Rounded corners */
  text-align: center; /* Center-align text */
  display: flex; /* Enable Flexbox */
  flex-direction: column; /* Stack elements vertically */
  justify-content: center; /* Vertically center content */
  align-items: center; /* Horizontally center content */
}

/* Pop-Up Content */
.popup-content {
  width: 100%; /* Ensure content spans the pop-up */
  text-align: center; /* Center-align text */
}

.popup h2 {
  font-size: 28px;
  margin: 10px 0;
  text-align: center; /* Ensure title is centered */
}

.popup p {
  font-size: 18px;
  margin: 20px 0;
  text-align: center; /* Ensure description is centered */
  line-height: 1.5; /* Improve readability */
}

/* Close Button */
.popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  font-size: 24px;
  color: #333;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent dark overlay */
  z-index: 999; /* Below pop-up but above everything else */
  display: none; /* Hidden by default */
}

.overlay.active {
  display: block;
}

/* Mobile Message */
.mobile-message {
  display: none; /* Hidden by default for desktop */
}

.download-buttons {
  display: flex;
  flex-direction: column; /* Arrange in vertical line */
  align-items: center; /* Center items horizontally */
  gap: 20px; /* Add spacing between items */
}

.download-icon {
  width: 150px;
  cursor: pointer;
}

/* Style the Back to Top button with a background image */
	#topBtn {
		display: none; /* Hidden by default */
		position: fixed; /* Stay in place */
		bottom: 20px; /* Place the button 20px from the bottom */
		right: 30px; /* Place the button 30px from the right */
		z-index: 99; /* Make sure it does not overlap */
		width: 50px; /* Width of the button */
		height: 50px; /* Height of the button */
		border: none; /* Remove borders */
		outline: none; /* Remove outline */
		background-image: url(https://res.cloudinary.com/hazo-connect/image/upload/v1734535561/Web-UpArrow_pduwuz.png); /* Add background image */
		background-size: cover; /* Ensure the background covers the button */
		cursor: pointer; /* Add a pointer on hover */
		border-radius: 50%; /* Add rounded corners */
		background-color: white; /* Make the background transparent */
	}

	/* Add a hover effect for the button */
	#topBtn:hover {
		background-color: #0094ff; /* Slightly darken background on hover */
	}

/* Mobile-Specific Pop-Up Adjustments */
@media screen and (max-width: 768px) {
    body {
        position: fixed;
        top: 50%; /* Center vertically */
        left: 50%; /* Center horizontally */
        transform: translate(-50%, -50%); /* Align center */
        background: rgba(255, 255, 255, 1); /* White background */
        z-index: 1000;
        width: 500px; /* Fixed width */
        padding: 20px;
        border-radius: 8px; /* Rounded corners */
        text-align: center; /* Center-align text */
        display: flex; /* Enable Flexbox */
        flex-direction: column; /* Stack elements vertically */
        justify-content: center; /* Vertically center content */
        align-items: center; /* Horizontally center content */
    }

    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 999; /* Below pop-up but above everything else */
        display: none; /* Hidden by default */
        background-color: transparent; /* Transparent to avoid visual interference */
    }

    .mobile-message p {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .apple-download img {
        opacity: 0.5; /* Grayed-out icon */
        pointer-events: none; /* Disable interactions with the image itself */
    }

    .apple-download {
        cursor: pointer; /* Keep the button clickable */
        background: none; /* Remove any button background */
        border: none; /* Ensure no border appears around the icon */
        padding: 0; /* Eliminate any padding */
    }

    .apple-download:hover img {
        opacity: 0.5; /* Maintain grayed-out look on hover */
    }

    .apple-popup {
	  display: none; /* Hidden by default */
	  position: fixed;
	  top: 50%; /* Center vertically */
	  left: 50%; /* Center horizontally */
	  transform: translate(-50%, -50%);
	  background-color: white; /* White background */
	  color: black; /* Black text for readability */
	  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Subtle shadow for depth */
	  border-radius: 8px; /* Rounded corners */
	  width: 85vw; /* Make width responsive to viewport width */
	  max-width: 500px; /* Set a maximum width for larger screens */
	  height: auto; /* Automatically adjust height based on content */
	  max-height: calc(100% - 40px); /* Leave room for padding on the top and bottom */
	  z-index: 1000; /* Above everything else */
	  padding: 27px 20px; /* Keep consistent padding (Top/Sides/Bottom) */
	  text-align: center; /* Center-align text */
	  overflow-y: auto; /* Add scrolling if content exceeds available height */
	}

    .popup-close {
        position: absolute;
        top: 10px;
        right: 10px;
        font-size: 18px;
        cursor: pointer;
    }

    #topBtn {
        display: none; /* Hide "Back to Top" button on mobile */
    }

    .container, .popup {
        display: none; /* Hide desktop content on mobile */
    }

    .mobile-message {
        display: flex; /* Show mobile-specific message */
        flex-direction: column; /* Stack items vertically */
        justify-content: center; /* Vertically center content */
        align-items: center; /* Horizontally center content */
        text-align: center;
        padding: 20px; /* Add padding for spacing */
    }
}

/* Dark Mode */
body.dark-mode {
  background-color: #000; /* Dark gray background */
  color: #FFF; /* Text remains black */
}

/* Pop-Up Styles in Dark Mode */
body.dark-mode .popup {
  background-color: #333; /* Dark background color */
  color: #fff; /* Light text color */
}