/* Add at the top of your style.css */
:root {
    --header-height: 60px; /* Adjust based on your actual header height */
  }

/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body Styles */
/* body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(135deg, #65AB3D, #F0AE37, #28B6E7);
    color: #333;
} */

body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: transparent; /* Make body background transparent to show the html background */
    color: #333;
}

/* Main Content Container */
main.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    padding-top: 10px;
    max-width: 1100px;
    width: 100%;
    margin-top: 10px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); /* Add subtle shadow */
}

/* Login Form Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 400px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin: auto;
}

.logo {
    width: 80px;
    margin-bottom: 20px;
}

.login-form h2 {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
    color: #444;
}

.login-form input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    border: 1px solid #ddd;
    text-align: center;
    font-size: 16px;
}

/* Button Styles */
button {
    padding: 10px;
    background: linear-gradient(to right, #65AB3D, #28B6E7);
    border: none;
    color: white;
    font-size: 1em;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: opacity 0.3s;
}

button:hover {
    opacity: 0.9;
}

/* Footer Styles */
footer.footer {
    background: #4d4d4d; /* Lighter than header's #3d3d3d */
    color: white; /* Make text white like the header */
    text-align: center;
    padding: 15px 20px;
    font-size: 0.9em;
    border-top: 1px solid #5a5a5a;
    width: 100%;
    flex-shrink: 0; /* Prevent footer from shrinking */
}

.footer p {
    margin: 0;
}

.valve-tile {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    margin: 10px;
    width: 200px;
    text-align: center;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    background-color: #fff;
}
.valve-tile img {
    width: 50px;
    margin-bottom: 10px;
}

.spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 20px;
}

.spinner img {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner-circle {
    width: 50px;
    height: 50px;
    border: 6px solid #f3f3f3; /* Light grey */
    border-top: 6px solid #3498db; /* Blue */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Alarm Styling */
.alert {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 5px;
    border-left: 5px solid transparent;
}

.alert-danger {
    background-color: #fff2f2;
    border-left-color: #dc3545;
}

.alert-warning {
    background-color: #fff8e6;
    border-left-color: #ffc107;
}

.alert-success {
    background-color: #f2fff2;
    border-left-color: #28a745;
}

.alert h4 {
    margin-top: 0;
    color: #333;
    font-size: 18px;
    font-weight: bold;
}

.alarm-details {
    margin: 10px 0;
    padding: 10px;
    background-color: rgba(0,0,0,0.03);
    border-radius: 4px;
}

.acknowledge-btn {
    margin-top: 10px;
}

.form-links {
    margin-top: 15px;
    text-align: center;
}

.form-links a {
    color: #28B6E7;
    text-decoration: none;
    font-size: 0.9em;
}

.form-links a:hover {
    text-decoration: underline;
}

.form-description {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
}

/* Make forms look consistent */
#forgotPasswordForm,
#resetPasswordForm,
#newPasswordForm {
    width: 100%;
}

/* Mobile font size adjustments */
@media (max-width: 768px) {
    h1 {
      font-size: 1.4rem;
    }
  
    h2 {
      font-size: 1.2rem;
    }
  
    #controllerStatus {
      font-size: 0.9rem;
      padding: 3px 8px;
    }
  }
  
  @media (max-width: 768px) {
    /* 1. Fix hamburger button to top-left and shrink its width */
    .sidebar-toggle-btn {
      top: 15px;
      left: 15px;
      right: auto; /* override right if set */
      width: 40px;
      height: 40px;
      padding: 8px;
      border-radius: 6px;
      font-size: 1.1rem;
      z-index: 1101;
    }
  
    /* 2. Ensure logo stays centered regardless of hamburger */
    .sidebar-toggle-btn {
      position: absolute;
      left: 15px;
    }
  }
  
  body {
    /* Ensure the body extends beneath the safe area */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    min-height: 100vh;
  }
  
  header, .navbar {
    /* Push the header down to avoid the status bar */
    padding-top: env(safe-area-inset-top);
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  
  /* If your header is fixed or absolute positioned, use this instead */
  header.fixed-top, .navbar.fixed-top {
    padding-top: env(safe-area-inset-top);
    top: 0;
  }
  
  /* For bottom navigation if you have it */
  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* Add to your style.css or create a new section in an existing CSS file */
html, body {
    overscroll-behavior-y: none; /* Prevents bounce effect in Safari */
  }
  
  main {
    /* Ensure main content starts after the header */
    margin-top: var(--header-height, 60px); /* Replace with your header height */
    /* Or use padding instead if that works better for your layout */
    /* padding-top: var(--header-height, 60px); */
  }

  /* Add to your style.css or header.css */
@media all and (display-mode: standalone) {
    body {
      /* Adjust to account for iOS UI */
      min-height: 100vh;
      background-color: #f5f5f5; /* Match your app background */
    }
    
    .navbar {
      padding-top: env(safe-area-inset-top);
    }
  }