@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap');

:root {
  --bg: rgba(255, 255, 255, 0.8);
  --text: #111;
  --input-bg: rgba(255, 255, 255, 0.6);
  --placeholder: #333;
  --table-text: #000;
}

body.dark {
  --bg: rgba(0, 0, 0, 0.7);
  --text: #fff;
  --input-bg: rgba(0, 0, 0, 0.3);
  --placeholder: #ccc;
  --table-text: #fff;
  background: #111;
}

* {
  font-family: 'Open Sans', sans-serif;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.background {
  position: fixed;
  width: 100%;
  height: 100%;
  background: linear-gradient(-45deg, #8ec5fc, #e0c3fc, #f9f9f9, #a1c4fd);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  z-index: -1;
}

/* 🌙 Navbar */
.navbar {
  width: 100%;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: var(--bg);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.nav-left {
  font-size: 1.4em;
  font-weight: bold;
  color: var(--text);
}

.nav-right {
  color: var(--text);
}

.theme-switch {
  font-size: 1em;
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: 600px;
  margin-top: 30px;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.8s ease;
}

.glass {
  background: var(--bg);
  backdrop-filter: blur(14px);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

h2 {
  text-align: center;
  color: var(--text);
  margin-bottom: 20px;
}

input[type="text"],
input[type="password"],
input[type="date"] {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: none;
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
}

input::placeholder {
  color: var(--placeholder);
}

input:focus {
  outline: none;
  box-shadow: 0 0 10px #6fd1ff;
}

button {
  padding: 12px 16px;
  margin-top: 10px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.primary {
  background: linear-gradient(to right, #00c9ff, #92fe9d);
  color: #000;
}

.secondary {
  background: #bbb;
  color: #000;
}

.danger {
  background: #ff4b5c;
  color: white;
}

.toggle-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.toggle {
  flex: 1;
  background: #fff;
  color: #000;
}

/* Table Styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: rgba(109, 109, 109, 0.5);
}

th, td {
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  text-align: center;
  color: var(--table-text);
}

td input[type="checkbox"] {
  transform: scale(1.2);
}

td button {
  padding: 8px 10px;
  margin: 2px;
  border-radius: 6px;
  font-size: 0.9em;
  width: auto;
}

td button:hover {
  filter: brightness(1.1);
}

.action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* Animations */
@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 20px;
  }

  table, thead, tbody, th, td, tr {
    display: block;
  }

  thead { display: none; }

  td {
    padding: 10px;
    position: relative;
  }

  td::before {
    content: attr(data-label);
    font-weight: bold;
    position: absolute;
    left: 0;
    color: #6e6d6d;
  }
}
