/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

body {
  margin: 0;
  background-color: #d0d0d0;
  transition: background-color 0.3s ease;
}

/* Navigation Bar */
.topnav {
  overflow: hidden;
  background-color: #f0f0f0;
  position: relative;
  box-shadow: 8px 8px 8px #161b1d2f;
  border-radius: 15px;
  padding: 5px;
  margin: 15px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.topnav a {
  float: left;
  display: block;
  color: #777;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
  font-weight: bold;
  border-radius: 12px;
  background-color: #f0f0f0;
  box-shadow: 8px 8px 8px #161b1d2f;
  transition: 0.3s;
  margin: 2px;
}

.topnav a:hover {
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.15), inset -2px -2px 4px rgba(255, 255, 255, 0.8);
  color: #04AA6D;
}

.topnav a.active {
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.15), inset -2px -2px 4px rgba(255, 255, 255, 0.8);
  color: #04AA6D;
}

.topnav .icon {
  display: none;
}

/* Main Container */
.pcontainer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: auto;
  box-sizing: border-box;
  min-height: 60vw;
  padding: 3vw;
  width: 80vw;
  border-radius: 35px;
  background-color: #ecf0f3;
  box-shadow: 8px 8px 8px #161b1d2f;
  margin-top: 10px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Logo */
.app-logo {
  margin-bottom: 2vw;
  position: relative;
}

#navbarImage {
  width: 66vw;
  height: 16vw;
  max-width: 300px;
  max-height: 80px;
  object-fit: contain;
}

.pro-badge {
  position: absolute;
  top: -8px;
  right: 0;
  background-color: #4c2882;
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 10px;
}

/* Medication Labels */
.text-box {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 2vw;
}

.text-box span {
  padding: 0.5vw;
  font-size: 4.5vw;
  font-weight: bold;
}

.text-box span:first-child {
  color: deeppink;
  margin-right: 20vw;
}

.text-box span:last-child {
  color: #1DA1F2;
}

/* Buttons */
.user-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1vw;
}

button {
  font-size: 5vw;
  font-weight: bold;
  text-align: center;
  padding: 1.5vw;
  color: #666666;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 6px 6px 12px #7b7b7b, -6px -6px 12px #ffffff;
  transition: 0.3s;
  margin-bottom: 3vw;
  width: 45vw;
  height: 10vw;
  max-width: 300px;
  max-height: 60px;
  background-color: #cccccc;
}

button:hover {
  transform: scale(1.02);
}

/* Language selector */
.language-selector {
  margin: 15px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.language-selector label {
  font-size: 16px;
  color: #666666;
}

.language-selector select {
  padding: 5px 10px;
  border-radius: 5px;
  border: none;
  background-color: #f0f0f0;
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.1);
  font-size: 14px;
}

/* Fixed theme toggle button alignment */
#theme-toggle {
  align-self: center;
  margin-top: 1vw;
  margin-left: auto;
  margin-right: auto;
  display: block;
  width: 45vw;
  text-align: center;
}

.vertical-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Dark Theme */
.dark-theme {
  background-color: #252525;
}

.dark-theme .topnav {
  background-color: #444444;
  box-shadow: 8px 8px 8px rgba(255, 255, 255, 0.05);
}

.dark-theme .topnav a {
  color: #ccc;
  background-color: #444444;
  box-shadow: 8px 8px 8px rgba(255, 255, 255, 0.05);
}

.dark-theme .topnav a:hover {
  box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.05), inset -2px -2px 4px rgba(0, 0, 0, 0.2);
  color: #04AA6D;
}

.dark-theme .topnav a.active {
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.15), inset -2px -2px 4px rgba(100, 100, 100, 0.8);
  color: #04AA6D;
}

.dark-theme .pcontainer {
  background-color: #444444;
  box-shadow: 8px 8px 8px rgba(200, 200, 200, 0.05);
}

.dark-theme button {
  color: #ccc;
  background-color: #333333;
  box-shadow: 8px 8px 8px rgba(0, 0, 0, 0.15), -6px -6px 12px rgba(100, 100, 100, 0.1);
}

.dark-theme .text-box span:first-child {
  background-color: #444444;
  color: #ff1493;
}

.dark-theme .text-box span:last-child {
  background-color: #444444;
  color: #1DA1F2;
}

.dark-theme .language-selector label {
  color: #cccccc;
}

.dark-theme .language-selector select {
  background-color: #333333;
  color: #cccccc;
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.3);
}

/* iOS Installation Modal */
#iosInstallModal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #ecf0f3;
  border-radius: 15px 15px 0 0;
  padding: 20px;
  box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
  z-index: 9999;
  text-align: center;
}

#iosInstallModal h3 {
  color: #333;
  margin-bottom: 10px;
  font-size: 18px;
}

#iosInstallModal div {
  margin: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#iosInstallModal img {
  width: 20px;
  height: 20px;
  margin-right: 10px;
}

#iosInstallModal p {
  margin: 0;
  font-size: 16px;
}

#iosInstallModal button {
  background-color: #4c2882;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 10px 20px;
  margin-top: 15px;
  font-weight: bold;
  width: auto;
  height: auto;
}

#iosInstallModal label {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  color: #666;
}

#iosInstallButton {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #4c2882;
  color: white;
  padding: 10px 15px;
  border-radius: 50px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 9998;
  font-weight: bold;
  cursor: pointer;
}

/* RTL Language Support */
[dir="rtl"] .topnav a {
  float: right;
}

[dir="rtl"] .text-box span:first-child {
  margin-right: 0;
  margin-left: 20vw;
}

/* Responsive Design */
@media screen and (max-width: 600px) {
  .topnav a:not(:first-child) {
    display: none;
  }
  .topnav a.icon {
    float: right;
    display: block;
  }
}

@media screen and (max-width: 600px) {
  .topnav.responsive {
    position: relative;
  }
  .topnav.responsive .icon {
    position: absolute;
    right: 0;
    top: 0;
  }
  .topnav.responsive a {
    float: none;
    display: block;
    text-align: left;
  }
  [dir="rtl"] .topnav.responsive a {
    text-align: right;
  }
}

@media screen and (min-width: 768px) {
  button, .text-box span {
    font-size: 18px;
  }
  .pcontainer {
    max-width: 600px;
  }
  #theme-toggle {
    width: 200px;
  }
  .language-selector label, .language-selector select {
    font-size: 16px;
  }
}

.instruction-section {
    margin-bottom: 20px;
}

.instruction-section:last-child {
    margin-bottom: 0;
}





