/* ============ Globaltime Calendar Notes (Hybrid CSS) ============ */

/* ---------- Base styles ---------- */
body {
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  margin: 0;
  padding: 0;
  background: #f9fafb;
  color: #111827;
}

/* Container */
.calendar-wrap {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  overflow: hidden;
}

/* Header */
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #2563eb;
  color: #fff;
  padding: 16px 20px;
}

.cal-header .month-title h2 {
  margin: 0;
  font-size: 20px;
}

.cal-header .month-title p {
  margin: 0;
  font-size: 13px;
  opacity: 0.9;
}

.cal-header .nav-buttons a {
  margin-left: 8px;
  padding: 6px 12px;
  background: #1d4ed8;
  border-radius: 6px;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s;
}

.cal-header .nav-buttons a:hover {
  background: #1e3a8a;
}

/* ---------- Calendar body ---------- */
.cal-body {
  display: grid;
  grid-template-columns: 1fr 280px;
}

/* Calendar grid */
.calendar {
  padding: 16px;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 600;
  margin-bottom: 6px;
  color: #374151;
}

/* Use new attractive design for days */
.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.day {
  min-height: 90px;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.00));
  border-radius: 10px;
  padding: 8px;
  position: relative;
  transition: transform .09s ease;
  cursor: pointer;
}

.day:hover {
  transform: translateY(-6px);
}

.muted-day {
  opacity: 0.35;
}

.date-num {
  font-weight: 700;
  font-size: 14px;
}

.today {
  background: linear-gradient(90deg, rgba(124,58,237,0.10), rgba(124,58,237,0.06));
  border: 1px solid rgba(124,58,237,0.18);
}

.today .date-num {
  background: #7c3aed;
  color: white;
  padding: 6px 8px;
  border-radius: 999px;
}

.event {
  margin-top: 8px;
  background: rgba(124,58,237,0.10);
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  color: #7c3aed;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------- Sidebar ---------- */
.sidebar {
  padding: 16px;
  border-left: 1px solid #e5e7eb;
  background: #f9fafb;
}

.sidebar h3 {
  margin-top: 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.accent { background: #2563eb; }
.today-color { background: #facc15; }
.small-note { font-size: 13px; color: #6b7280; }

/* ---------- Note panel ---------- */
.note-panel {
  padding: 16px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

.calendar-input-wrapper {
  position: relative;
  margin-bottom: 12px;
}

.calendar-input-wrapper input {
  width: 100%;
  padding: 10px 36px 10px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.calendar-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 16px;
  color: #6b7280;
}

textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  resize: vertical;
}

/* ---------- Login button ---------- */
.login-btn {
  display: inline-block;
  padding: 8px 16px;
  background: #2563eb;
  color: #fff !important;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  animation: blink 1.5s infinite;
  transition: background 0.3s, transform 0.2s;
}

.login-btn:hover {
  background: #1d4ed8;
  transform: scale(1.05);
}

/* Blink effect */
@keyframes blink {
  0%, 100% { box-shadow: 0 0 0px rgba(37,99,235,0.8); }
  50% { box-shadow: 0 0 14px rgba(37,99,235,0.8); }
}

#status button {
  margin-top: 8px;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

#status button:hover {
  background: #1e3a8a;
}

#deleteBtn {
  background: #dc2626 !important;
}

#deleteBtn:hover {
  background: #b91c1c !important;
}

/* ---------- Flatpickr saved dates ---------- */
.flatpickr-day.saved-date {
  background: #2563eb;
  color: #fff !important;
  border-radius: 50%;
}

/* ---------- Dark mode ---------- */
body.dark-mode {
  background: #111827;
  color: #e5e7eb;
}

body.dark-mode .calendar-wrap {
  background: #1f2937;
}

body.dark-mode .cal-header {
  background: #374151;
}

body.dark-mode .day {
  background: #1f2937;
  border-color: #374151;
}

body.dark-mode .today {
  border: 1px solid #7c3aed;
  background: rgba(124,58,237,0.15);
}

body.dark-mode .today .date-num {
  background: #7c3aed;
  color: #fff;
}

body.dark-mode .event {
  background: rgba(124,58,237,0.25);
  color: #c4b5fd;
}

body.dark-mode .sidebar {
  background: #111827;
  border-color: #374151;
}

body.dark-mode .note-panel {
  background: #1f2937;
  border-color: #374151;
}

body.dark-mode textarea,
body.dark-mode input {
  background: #111827;
  color: #e5e7eb;
  border-color: #374151;
}

/* ---------- Responsive Design ---------- */

/* Tablet (max-width: 992px) */
@media (max-width: 992px) {
  .cal-body {
    grid-template-columns: 1fr; /* Sidebar नीचे चला जाएगा */
  }
  .sidebar {
    border-left: none;
    border-top: 1px solid #e5e7eb;
    margin-top: 16px;
  }
}

/* Mobile (max-width: 600px) */
@media (max-width: 600px) {
  .cal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .cal-header .month-title h2 {
    font-size: 18px;
  }
  .cal-header .nav-buttons {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }
  .days {
    gap: 4px;
  }
  .day {
    min-height: 70px;
    padding: 6px;
  }
  .date-num {
    font-size: 12px;
  }
  .event {
    font-size: 11px;
    padding: 4px 6px;
  }
  .note-panel {
    padding: 12px;
  }
  textarea {
    min-height: 70px;
    font-size: 13px;
  }
  .calendar-input-wrapper input {
    font-size: 13px;
    padding: 8px 32px 8px 8px;
  }
}

