:root {
  --bg-body: #f4f4f7;
  --bg-card: #ffffff;
  --text-main: #1a1a1a;
  --text-muted: #636e72;
  --primary: #ff6b35;
  --primary-light: #ffb38e;
  --border: #dfe6e9;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  --radius: 20px;
  --font-body: "Poppins", sans-serif;
  --color-logo: brightness(0);
}

body.dark-mode {
  --bg-body: #0a0a0a;
  --bg-card: #141414;
  --text-main: #f5f5f5;
  --text-muted: #8e8e93;
  --border: #2c2c2e;
  --shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  --color-logo: brightness(0) invert(1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-body);
  color: var(--text-main);
  transition: all 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 5%;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.ghost-gym img {
  width: 45px;
  filter: var(--color-logo);
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 8px;
  background: var(--bg-card);
  padding: 5px;
  border-radius: 50px;
  border: 1px solid var(--border);
}

.main-nav a {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  text-decoration: none;
  transition: 0.2s;
}

.main-nav a.active {
  background: var(--text-main);
  color: var(--bg-card);
}

.icon-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-main);
  cursor: pointer;
}

main {
  flex: 1;
  padding: 1.5rem 5%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.view-section {
  width: 100%;
  max-width: 900px;
  display: none;
  animation: fadeIn 0.4s ease;
}
.view-section.active {
  display: flex !important;
  flex-direction: column;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  width: 100%;
}

.card {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: center;
}

#attendance-count {
  font-size: 4.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0.5rem 0;
}

.counter-controls {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
}
.btn-action {
  flex: 2;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: var(--text-main);
  color: var(--bg-card);
  font-weight: 600;
  cursor: pointer;
}
.btn-reset {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: var(--text-main);
  color: var(--bg-card);
  font-weight: 600;
  cursor: pointer;
}

textarea {
  width: 100%;
  min-height: 110px;
  padding: 1rem;
  border-radius: 12px;
  background: var(--bg-body);
  color: var(--text-main);
  border: 1px solid var(--border);
  font-family: inherit;
  resize: none;
  margin-bottom: 1rem;
}

.notes-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  width: 100%;
  margin-top: 2rem;
}
.note-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius);
  border-top: 4px solid var(--primary);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.avise-wrapper {
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avise-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}
.btn-ghost-ring {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 4px solid var(--primary-light);
  background: transparent;
  padding: 12px;
  cursor: pointer;
  transition: 0.4s;
}
.ring-inner {
  width: 100%;
  height: 100%;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  gap: 12px;
}
.btn-ghost-ring:hover {
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(255, 107, 53, 0.4);
}

.settings-list {
  width: 100%;
  max-width: 500px;
}
.settings-group {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem;
  border-bottom: 1px solid var(--border);
}
.setting-item:last-child {
  border-bottom: none;
}
.setting-info {
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
}
.setting-info i {
  font-size: 1.2rem;
  color: var(--text-muted);
}
.setting-info div {
  display: flex;
  flex-direction: column;
}
.setting-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.main-footer {
  padding: 4rem 1rem;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border);
  width: 100%;
  margin-top: auto;
}
.footer-container {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.footer-logo {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.footer-links {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
}
.footer-links a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}
.modal-card {
  background: var(--bg-card);
  padding: 2.5rem;
  border-radius: 25px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  border: 1px solid var(--border);
}
.modal-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1rem;
}
.btn-modal {
  margin-top: 1.5rem;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: var(--text-main);
  color: var(--bg-card);
  font-weight: 600;
  cursor: pointer;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border);
  transition: 0.4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #34c759;
}
input:checked + .slider:before {
  transform: translateX(20px);
}

.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
