.wrap {
  .calendar-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0px 0 20px 0;
    gap: 1em;
    position: relative;

    .button {
      text-align: center;
      min-width: 100px;

      &.drafts-button {
        position: absolute;
        right: 0;
      }
    }

    .calendar-legend {
      position: absolute;
      left: 0;
      display: flex;
      gap: 1em;
      align-items: center;

      .legend-item {
        display: flex;
        align-items: center;
        gap: 0.5em;
        font-size: 13px;

        .legend-color {
          width: 12px;
          height: 12px;
          border-radius: 2px;
          display: inline-block;
          border: 1px solid #ddd;
        }

        .legend-text {
          color: #666;
        }
      }
    }

    > div {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 1em;
      flex-wrap: nowrap;
    }

    a {
      text-decoration: none;
    }
  }

  .calendar-table {
    width: 100%;
    border-collapse: collapse;

    th {
      text-align: center;
      padding: 10px;
      background: #f0f0f1;
    }

    td {
      width: 14.28%;
      height: 100px;
      padding: 5px;
      vertical-align: top;
      border: 1px solid #ddd;

      &.empty {
        background: #f9f9f9;
      }

      &.day {
        position: relative;

        &.today {
          background: #e6ffe6;
        }
      }
    }
  }

  .day-number {
    font-weight: bold;
    margin-bottom: 5px;
  }

  .posts-list {
    font-size: 12px;
  }

  .post-item {
    margin-bottom: 3px;
    padding: 2px 4px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;

    .post-time {
      opacity: 0.7;
      font-size: 0.9em;
    }

    &:hover {
      background: #f0f0f1;
    }
  }

  // Custom color classes for dynamic theming
  .custom-published-color {
    // Will be overridden by inline styles
  }

  .custom-scheduled-color {
    // Will be overridden by inline styles
  }

  // Text color classes for light/dark backgrounds
  .light-text {
    color: white !important;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
  }

  .dark-text {
    color: black !important;
    text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5);
  }

  // Welcome box styling (shared between settings and calendar pages)
  .post-calendar-hero-box {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);

    h2 {
      margin-top: 0;
      color: #23282d;
      font-size: 1.3em;
    }

    ul {
      margin: 15px 0;
      padding-left: 20px;
    }

    li {
      margin: 8px 0;
      line-height: 1.5;
    }
  }

  .calendar-tooltip {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0.25em;
    z-index: 100000;
    width: 300px;

    .post-item-title {
      line-height: 1.2;

      .post-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
        display: block;
      }
      small {
        opacity: 0.5;
        display: block;
      }
    }
  }

  #calendar-form {
    margin-top: 10px;
  }

  .mini-calendar {
    width: 100%;
    margin-top: 10px;

    &-navigation {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 5px;
      gap: 4px;

      a {
        text-decoration: none;
        color: #2271b1;
        background: #f0f0f1;
        border: 1px solid #ddd;
        border-radius: 3px;
        padding: 2px 8px;
        flex: 1;
        text-align: center;

        &:hover {
          background: #e6e6e6;
        }
      }

      .month-title {
        cursor: pointer;
        flex: 2;
        text-align: center;
      }
    }

    &-table {
      width: 100%;
      border-collapse: collapse;

      th {
        text-align: center;
        padding: 2px;
        background: #f0f0f1;
        font-size: 11px;
      }

      td {
        text-align: center;
        padding: 2px;
        border: 1px solid #ddd;
        font-size: 11px;
        height: auto;
        cursor: pointer;

        &.empty {
          background: #f9f9f9;
        }

        &:hover:not(.empty) {
          background: #f0f0f1;
        }

        &.highlighted {
          background: #2271b1;
          color: white;
          font-weight: bold;

          &:hover {
            background: #135e96;
          }
        }

        &.current-post-date {
          background: #f0f0f1;
          color: #666;
        }

        &.selected {
          background: limegreen;
          color: white;
        }

        &:not(.empty):not(.current-post-date):hover {
          background: #e6ffe6;
        }
      }
    }
  }

  .date-select-button {
    margin-top: 10px !important;
    width: 100%;
    display: block !important;
  }

  .time-picker-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
  }

  .time-picker {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 4px;

    .time-separator {
      font-weight: bold;
      color: #666;
    }

    select {
      padding: 2px;
      font-size: 11px;
      border: none;
      background: #fff;
      cursor: pointer;
      text-align: center;
      text-align-last: center;

      &:hover {
        background: #f0f0f1;
      }
    }

    .hour-24,
    .hour-12 {
      width: 45px;
    }

    .minutes {
      width: 45px;
    }

    .ampm {
      width: 50px;
    }
  }

  .calendar-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    gap: 1em;

    .button {
      text-align: center;
      min-width: 100px;
    }
  }

  .notice.notice-calendar {
    position: fixed;
    top: 40px;
    right: 20px;
  }
}
