* {
  box-sizing: border-box;
}

:root {
  --blue: #0086cd;
  --blue-dark: #006da8;
  --blue-light: #e8f6fd;
  --yellow: #fecc1b;
  --green: #7fc242;
  --green-dark: #4f8b1d;
  --white: #ffffff;

  --ink: #102a3a;
  --muted: #667985;
  --background: #f4f8fa;
  --surface: #ffffff;
  --border: #d8e3e8;
  --danger: #b42318;
  --danger-light: #fff2f1;

  --shadow:
    0 12px 34px rgba(16, 42, 58, 0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--background);
  font-family: Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  transition:
    background 150ms ease,
    opacity 150ms ease,
    transform 150ms ease;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

[hidden] {
  display: none !important;
}

/* כניסה */

.auth-screen {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
  background:
    radial-gradient(
      circle at top right,
      rgba(0, 134, 205, 0.2),
      transparent 40%
    ),
    radial-gradient(
      circle at bottom left,
      rgba(127, 194, 66, 0.17),
      transparent 40%
    ),
    #f7fafc;
}

.auth-card {
  width: min(100%, 420px);
  padding: 32px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow:
    0 20px 60px rgba(16, 42, 58, 0.15);
}

.auth-logo,
.eyebrow {
  display: inline-block;
  margin-bottom: 15px;
  color: var(--blue);
  font-weight: bold;
}

.auth-logo {
  padding: 7px 12px;
  background: var(--blue-light);
  border-radius: 999px;
}

.auth-card h1 {
  margin: 0 0 8px;
}

.auth-card > p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.auth-card label,
.modal label,
.filter-field label {
  display: block;
  margin: 14px 0 7px;
  font-weight: bold;
}

.auth-card input,
.modal input,
.modal select,
.modal textarea,
.filter-field input,
.filter-field select {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.auth-card input:focus,
.modal input:focus,
.modal select:focus,
.modal textarea:focus,
.filter-field input:focus,
.filter-field select:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(0, 134, 205, 0.13);
}

.logged-out .home-screen,
.logged-out .gantt-header,
.logged-out .gantt-main {
  display: none;
}

body:not(.logged-out) .auth-screen {
  display: none;
}

/* כפתורים */

.primary-button,
.secondary-button,
.yellow-button,
.green-button,
.danger-button,
.back-button,
.today-button,
.filter-toggle-button,
.icon-nav-button,
.view-button {
  padding: 10px 15px;
  border-radius: 9px;
  cursor: pointer;
}

.primary-button {
  color: var(--white);
  background: var(--blue);
  border: 1px solid var(--blue);
}

.primary-button:hover {
  background: var(--blue-dark);
}

.secondary-button,
.back-button,
.icon-nav-button {
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--border);
}

.back-button {
  color: var(--blue);
  border-color: var(--blue);
}

.yellow-button {
  color: #263843;
  background: var(--yellow);
  border: 1px solid var(--yellow);
  font-weight: bold;
}

.green-button {
  color: #244b0d;
  background: #f2faeb;
  border: 1px solid var(--green);
}

.danger-button {
  color: var(--danger);
  background: var(--danger-light);
  border: 1px solid #f2b8b3;
}

.text-button {
  padding: 8px;
  color: var(--blue);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.full-button {
  width: 100%;
  margin-top: 18px;
}

/* מסך הבית */

.home-screen {
  min-height: 100vh;
  padding: 40px;
  background:
    linear-gradient(
      135deg,
      rgba(0, 134, 205, 0.1),
      rgba(127, 194, 66, 0.08)
    ),
    #f7fafc;
}

.home-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto 32px;
}

.home-header h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 5vw, 48px);
}

.home-header p {
  margin: 0;
  color: var(--muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-details {
  display: grid;
  gap: 3px;
  text-align: left;
}

.user-details span {
  color: var(--muted);
  font-size: 12px;
}

.gantts-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
  max-width: 1200px;
  margin: auto;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 60px 24px;
  background: var(--white);
  border: 2px dashed rgba(0, 134, 205, 0.3);
  border-radius: 18px;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.gantt-card {
  padding: 22px;
  cursor: pointer;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 5px solid var(--blue);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.gantt-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 16px 38px rgba(16, 42, 58, 0.14);
}

.gantt-card h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.gantt-card-dates {
  color: var(--muted);
  font-size: 14px;
}

.gantt-card-role {
  display: inline-block;
  margin-top: 16px;
  padding: 5px 9px;
  color: #285d15;
  background: rgba(127, 194, 66, 0.18);
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
}

.gantt-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.delete-gantt-button {
  padding: 7px 10px;
  color: var(--danger);
  background: var(--white);
  border: 1px solid #f2b8b3;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}

/* כותרת הגאנט */

.gantt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.gantt-heading {
  display: flex;
  align-items: center;
  gap: 18px;
}

.gantt-heading h1 {
  margin: 0 0 5px;
  font-size: 25px;
}

.gantt-heading p {
  margin: 0;
  color: var(--muted);
}

/* סביבת עבודה */

.gantt-main {
  padding: 26px;
}

.workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.view-switcher {
  display: flex;
  padding: 4px;
  background: #eaf1f4;
  border-radius: 11px;
}

.view-button {
  color: var(--muted);
  background: transparent;
  border: 0;
}

.view-button.active {
  color: var(--white);
  background: var(--blue);
}

.period-navigation {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-nav-button {
  width: 40px;
  padding: 9px;
}

.today-button {
  color: var(--blue);
  background: var(--white);
  border: 1px solid var(--blue);
}

.filter-toggle-button {
  color: var(--ink);
  background: var(--yellow);
  border: 1px solid var(--yellow);
  font-weight: bold;
}

.filters-panel {
  display: grid;
  grid-template-columns:
    minmax(220px, 2fr)
    repeat(4, minmax(130px, 1fr))
    auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 15px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.filter-field label {
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
}

.results-summary {
  min-height: 20px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 13px;
}

/* תצוגות לוח */

.calendar-view {
  min-height: 560px;
}

.timeline-view {
  display: flex;
  gap: 12px;
  min-height: 540px;
  padding: 16px;
  overflow-x: auto;
  direction: ltr;
  scroll-behavior: smooth;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.day-column {
  flex: 0 0 220px;
  min-height: 480px;
  padding: 14px;
  direction: rtl;
  background: #fbfdfe;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.day-column.today {
  background: var(--blue-light);
  border: 2px solid var(--blue);
}

.day-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 12px;
  background: inherit;
}

.day-name {
  color: var(--muted);
  font-size: 13px;
}

.day-date {
  margin-top: 4px;
  font-size: 18px;
  font-weight: bold;
}

.today-label {
  display: inline-block;
  margin-top: 7px;
  padding: 3px 8px;
  color: var(--blue);
  background: var(--white);
  border-radius: 999px;
  font-size: 11px;
  font-weight: bold;
}

.day-tasks {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.empty-day {
  margin-top: 40px;
  color: #8a9aa3;
  text-align: center;
  font-size: 13px;
}

.single-day-view {
  min-height: 540px;
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.single-day-header {
  margin-bottom: 18px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.single-day-header h2 {
  margin: 0 0 5px;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 10px;
  overflow-x: auto;
}

.week-day {
  min-height: 430px;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 7px;
  overflow-x: auto;
}

.month-weekday {
  padding: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: bold;
}

.month-day {
  min-height: 130px;
  padding: 9px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.month-day.outside-range {
  opacity: 0.35;
}

.month-day.today {
  border: 2px solid var(--blue);
}

.month-day-number {
  margin-bottom: 8px;
  font-weight: bold;
}

.month-task {
  margin-bottom: 5px;
  padding: 5px 7px;
  overflow: hidden;
  cursor: pointer;
  border-radius: 6px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* כרטיסי משימות */

.task-card {
  padding: 11px;
  cursor: pointer;
  background: var(--white);
  border: 1px solid var(--border);
  border-right: 5px solid var(--blue);
  border-radius: 9px;
  box-shadow:
    0 3px 10px rgba(16, 42, 58, 0.08);
}

.task-card:hover {
  transform: translateY(-1px);
  box-shadow:
    0 7px 17px rgba(16, 42, 58, 0.12);
}

.task-card.content,
.month-task.content {
  border-right-color: var(--blue);
  background-color: #edf8fd;
}

.task-card.digital,
.month-task.digital {
  border-right-color: var(--green);
  background-color: #f2f9eb;
}

.task-card.production,
.month-task.production {
  border-right-color: var(--yellow);
  background-color: #fff9df;
}

.task-card.other,
.month-task.other {
  border-color: var(--blue);
  background-color: var(--white);
}

.task-card.status-done {
  opacity: 0.65;
}

.task-card.status-done .task-title {
  text-decoration: line-through;
}

.task-title {
  font-weight: bold;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.task-badge {
  padding: 3px 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  font-size: 11px;
}

/* פס משימה מתמשכת */

.gantt-bars {
  position: relative;
}

.multi-day-task {
  background-image:
    linear-gradient(
      90deg,
      rgba(0, 134, 205, 0.08),
      transparent
    );
}

/* חלונות */

.modal {
  width: min(92vw, 560px);
  max-height: 90vh;
  padding: 0;
  color: var(--ink);
  background: var(--white);
  border: 0;
  border-radius: 17px;
  box-shadow:
    0 24px 70px rgba(16, 42, 58, 0.27);
}

.small-modal {
  width: min(92vw, 430px);
}

.task-modal {
  width: min(94vw, 650px);
}

.modal::backdrop {
  background: rgba(16, 42, 58, 0.58);
  backdrop-filter: blur(3px);
}

.modal form {
  padding: 24px;
}

.modal-header,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.modal-header {
  margin-bottom: 20px;
}

.modal-header h2,
.section-heading h3 {
  margin: 0 0 5px;
}

.modal-header p,
.section-heading span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.close-button {
  width: 36px;
  height: 36px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
}

.close-button:hover {
  background: var(--background);
}

.modal textarea {
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.field-help {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.form-message {
  min-height: 20px;
  margin: 11px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

/* שותפים */

.member-add-grid {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  align-items: end;
  gap: 10px;
}

.members-list {
  display: grid;
  gap: 9px;
  max-height: 330px;
  padding: 0 24px 24px;
  overflow-y: auto;
}

.member-row {
  display: grid;
  grid-template-columns: 1fr 150px auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--background);
  border-radius: 10px;
}

.member-name {
  font-weight: bold;
}

.member-role-select {
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.remove-member-button {
  padding: 7px 9px;
  color: var(--danger);
  background: var(--white);
  border: 1px solid #f2b8b3;
  border-radius: 8px;
  cursor: pointer;
}

/* תגובות */

.comments-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.comments-list {
  display: grid;
  gap: 10px;
  max-height: 220px;
  margin-top: 12px;
  overflow-y: auto;
}

.comment-item {
  padding: 11px 12px;
  background: var(--background);
  border-radius: 10px;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.comment-author {
  font-weight: bold;
}

.comment-date {
  color: var(--muted);
  font-size: 12px;
}

.comment-body {
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-delete {
  margin-top: 7px;
  padding: 0;
  color: var(--danger);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 12px;
}

.no-comments {
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.new-comment {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 9px;
  margin-top: 12px;
}

/* התאמה למסכים קטנים */

@media (max-width: 1050px) {
  .filters-panel {
    grid-template-columns: repeat(3, 1fr);
  }

  .search-field {
    grid-column: span 2;
  }
}

@media (max-width: 750px) {
  .home-screen,
  .gantt-main {
    padding: 20px 16px;
  }

  .home-header,
  .gantt-header,
  .workspace-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions,
  .period-navigation {
    flex-wrap: wrap;
  }

  .user-details {
    width: 100%;
    text-align: right;
  }

  .view-switcher {
    overflow-x: auto;
  }

  .view-button {
    flex: 1 0 auto;
  }

  .filters-panel {
    grid-template-columns: 1fr 1fr;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .day-column {
    flex-basis: 82vw;
  }

  .member-add-grid,
  .member-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .auth-card,
  .modal form {
    padding: 21px;
  }

  .form-grid,
  .filters-panel,
  .new-comment {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: auto;
  }

  .modal-actions {
    flex-direction: column;
  }
}/* תיקון כותרות תצוגת חודש */
.month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
  direction: rtl;
  background: #ffffff;
  border: 1px solid #d7e3ea;
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
}

.month-weekday {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 12px 6px;
  color: #536475;
  font-weight: 700;
  text-align: center;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
  direction: rtl;
}

/* צבעי קטגוריות המשימות */
.task-card.category-content {
  background: #0086cd !important;
  border-color: #0075b4 !important;
  color: #ffffff !important;
}

.task-card.category-digital {
  background: #fecc1b !important;
  border-color: #ddb000 !important;
  color: #172033 !important;
}

.task-card.category-production {
  background: #7fc242 !important;
  border-color: #68a732 !important;
  color: #172033 !important;
}

.task-card.category-other {
  background: #ffffff !important;
  border-color: #9aabba !important;
  color: #172033 !important;
}

/* הפס בצד יקבל את צבע הקטגוריה */
.task-card.category-content,
.task-card.category-digital,
.task-card.category-production,
.task-card.category-other {
  border-right-width: 6px !important;
  border-right-style: solid !important;
}

.task-card.category-content {
  border-right-color: #006ea9 !important;
}

.task-card.category-digital {
  border-right-color: #c99d00 !important;
}

.task-card.category-production {
  border-right-color: #579526 !important;
}

.task-card.category-other {
  border-right-color: #64748b !important;
}

/* טקסט משני על רקע כחול */
.task-card.category-content .task-meta,
.task-card.category-content .task-assignee,
.task-card.category-content .task-date-range,
.task-card.category-content .task-time {
  color: #ffffff !important;
}

/* התאמה למסכים צרים */
@media (max-width: 750px) {
  .month-view {
    min-width: 850px;
  }
}
