/* --- ZMIENNE I RESET --- */
:root {
  --bg-dark: #121418;
  --bg-card: #1c1f26;
  --bg-input: #131519;
  --primary: #ffffff;
  --accent: #3e4352;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);
  
  --accent-gradient: linear-gradient(180deg, #2a2e38 0%, #1f2229 100%);
  --accent-gradient-hover: linear-gradient(180deg, #323642 0%, #252933 100%);
  --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  
  /* User badge colors */
  --color-seba: #eab308;  /* Gold */
  --color-adam: #3b82f6;  /* Blue */
  --color-aiquit: #ec4899; /* Pink */
  --color-gosc: #94a3b8;   /* Slate/Gray */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: radial-gradient(circle at center, #1c1f26 0%, #121418 100%) fixed;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Custom Scrollbar */
body::-webkit-scrollbar {
  width: 8px;
  background-color: var(--bg-dark);
}

body::-webkit-scrollbar-thumb {
  background-color: var(--accent);
  border-radius: 10px;
  border: 2px solid var(--bg-dark);
}

body::-webkit-scrollbar-thumb:hover {
  background-color: #5c637a;
}

/* Containers */
.container {
  display: none;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  animation: fadeIn 0.4s ease-out;
}

.container.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- AUTHENTICATION SCREEN --- */
#auth-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: 12px;
  padding: 40px 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  font-size: 2.8rem;
  color: white;
  margin-bottom: 12px;
  display: inline-block;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.auth-logo h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  color: white;
}

.auth-logo p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Input Fields & Forms */
.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: color 0.3s;
}

.input-wrapper input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px 14px 46px;
  background: var(--bg-input);
  border: var(--glass-border);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.form-group textarea {
  padding: 14px 16px;
  resize: none;
}

.input-wrapper input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--bg-card);
}

.input-wrapper input:focus + .input-icon {
  color: white;
}

/* Error Messages */
.error-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 20px;
  animation: shake 0.3s ease-in-out;
}

.error-msg.hidden {
  display: none;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 15px;
  background: var(--accent-gradient);
  border: var(--glass-border);
  border-radius: 6px;
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s;
}

.btn-primary:hover {
  background: var(--accent-gradient-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  width: 100%;
  padding: 15px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-main);
  color: white;
}

/* --- DASHBOARD HEADER --- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: var(--glass-border);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-area i {
  font-size: 1.8rem;
  color: white;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.15));
}

.text-gradient {
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-area h2 {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.1;
  color: white;
}

.sub-title {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#user-display-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: white;
}

#user-role-badge {
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
  text-transform: uppercase;
}

/* User Badges Mapping */
.badge-seba { background: rgba(234, 179, 8, 0.12) !important; color: var(--color-seba) !important; border: 1px solid rgba(234, 179, 8, 0.2); }
.badge-adam { background: rgba(59, 130, 246, 0.12) !important; color: var(--color-adam) !important; border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-aiquit { background: rgba(236, 72, 153, 0.12) !important; color: var(--color-aiquit) !important; border: 1px solid rgba(236, 72, 153, 0.2); }
.badge-gosc { background: rgba(148, 163, 184, 0.12) !important; color: var(--color-gosc) !important; border: 1px solid rgba(148, 163, 184, 0.2); }

.btn-icon {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-icon:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

/* --- STATS SECTION --- */
.stats-section {
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.icon-blue {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.icon-green {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.15);
}

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.1;
  color: white;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* --- ADMIN FILTERS (SEBA ONLY) --- */
.filters-section {
  margin-bottom: 20px;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
}

.chip:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}

.chip.active {
  background: var(--accent-gradient);
  border-color: rgba(255, 255, 255, 0.15);
  color: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* --- CALENDAR CARD --- */
.calendar-section {
  margin-bottom: 20px;
}

.calendar-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.calendar-header h3 {
  font-weight: 600;
  font-size: 1.05rem;
  color: white;
}

.btn-calendar-nav {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-calendar-nav:hover {
  border-color: var(--text-main);
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 6px;
  column-gap: 6px;
}

.day-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}

.day-cell:hover:not(.empty) {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: white;
}

.day-cell.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
  pointer-events: none;
}

.day-cell.today {
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
}

.day-cell.selected {
  background: white !important;
  color: var(--bg-dark) !important;
  border-color: white !important;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(255, 255, 255, 0.2);
}

/* DOTS FOR DAYS WITH ENTRIES */
.day-dots {
  position: absolute;
  bottom: 6px;
  display: flex;
  gap: 3px;
  justify-content: center;
  width: 100%;
}

.dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

/* User dots colors mapping */
.dot-seba { background-color: var(--color-seba); }
.dot-adam { background-color: var(--color-adam); }
.dot-aiquit { background-color: var(--color-aiquit); }
.dot-gosc { background-color: var(--color-gosc); }

/* --- ENTRIES SECTION --- */
.entries-section {
  margin-bottom: 70px;
}

.entries-header {
  margin-bottom: 12px;
}

#selected-day-label {
  font-weight: 700;
  color: white;
}

.entries-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entry-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  animation: slideIn 0.3s ease-out;
}

.entry-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: #23262e;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.entry-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.entry-user-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.entry-time-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.entry-time-badge i {
  color: white;
}

.entry-description {
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.entry-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
}

.entry-duration {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-delete-entry {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.3s;
}

.btn-delete-entry:hover {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.2);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed var(--glass-border);
  border-radius: 8px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.8rem;
}

/* --- FLOATING ACTION BUTTON (FAB) --- */
.fab-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: white;
  border: none;
  color: var(--bg-dark);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
  cursor: pointer;
  z-index: 99;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab-btn:hover {
  transform: scale(1.05);
  background: #f1f5f9;
}

.fab-btn:active {
  transform: scale(0.9) rotate(45deg);
}

/* --- BOTTOM SHEET MODAL --- */
.modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  display: none;
  justify-content: center;
  align-items: flex-end;
}

.modal-container.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 20, 24, 0.8);
  backdrop-filter: blur(4px);
  animation: fadeInOverlay 0.3s ease-out forwards;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.bottom-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #14171d;
  border-top: var(--glass-border);
  border-radius: 12px 12px 0 0;
  padding: 16px 20px 32px 20px;
  z-index: 101;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
  to { transform: translateY(0); }
}

.sheet-drag-handle {
  width: 40px;
  height: 4px;
  background: var(--text-muted);
  opacity: 0.2;
  border-radius: 2px;
  margin: 0 auto 16px auto;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.sheet-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
}

.btn-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-close:hover {
  border-color: var(--text-main);
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
  margin-top: 10px;
}
