﻿/* ============================================================
   Nop.Plugin.Misc.NopPersianDate — Persian Date Picker Styles
   ============================================================
   Complete CSS for the Persian (Jalali) date picker component.
   Features:
   - RTL (right-to-left) layout
   - Bootstrap-compatible styling
   - Mobile responsive
   - Calendar popover
   - Time picker
   ============================================================ */

/* ---------- Calendar Container ---------- */
.pdp-calendar-container {
  position: absolute;
  z-index: 99999;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  width: 320px;
  max-width: calc(100vw - 32px);
  direction: rtl;
  font-family: 'Vazirmatn', 'Tahoma', 'Segoe UI', sans-serif;
  overflow: hidden;
  display: none;
  animation: pdp-fade-in 0.2s ease-out;
}

  .pdp-calendar-container.pdp-show {
    display: block;
  }

@keyframes pdp-fade-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Calendar Header ---------- */
.pdp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #2c9c5f, #1d7d46);
  color: #ffffff;
  font-size: 14px;
}

.pdp-header-title {
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  flex: 1;
}

.pdp-nav-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background 0.2s;
  padding: 0;
}

  .pdp-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
  }

  .pdp-nav-btn:active {
    background: rgba(255, 255, 255, 0.4);
  }

/* ---------- Year/Month Selector Row ---------- */
.pdp-selector-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.pdp-month-select,
.pdp-year-select {
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 13px;
  background: #ffffff;
  color: #495057;
  cursor: pointer;
  direction: rtl;
}

  .pdp-month-select:focus,
  .pdp-year-select:focus {
    outline: none;
    border-color: #2c9c5f;
    box-shadow: 0 0 0 2px rgba(44, 156, 95, 0.15);
  }

/* ---------- Day-of-Week Headers ---------- */
.pdp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 8px 8px 4px;
  background: #ffffff;
}

.pdp-weekday {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #6c757d;
  padding: 4px 0;
}

/* ---------- Days Grid ---------- */
.pdp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 4px 8px 8px;
  background: #ffffff;
}

.pdp-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f8f9fa;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #495057;
  transition: all 0.15s ease;
  min-height: 36px;
  padding: 0;
}

  .pdp-day:hover {
    background: #e3f2ed;
    color: #1d7d46;
  }

  .pdp-day.pdp-today {
    font-weight: 700;
    border: 2px solid #2c9c5f;
  }

  .pdp-day.pdp-selected {
    background: #2c9c5f;
    color: #ffffff;
    font-weight: 600;
  }

    .pdp-day.pdp-selected:hover {
      background: #1d7d46;
    }

  .pdp-day.pdp-other-month {
    color: #adb5bd;
    background: transparent;
  }

    .pdp-day.pdp-other-month:hover {
      background: #f1f3f5;
    }

  .pdp-day.pdp-disabled {
    color: #ced4da;
    cursor: not-allowed;
    background: transparent;
  }

    .pdp-day.pdp-disabled:hover {
      background: transparent;
      color: #ced4da;
    }

/* ---------- Time Picker ---------- */
.pdp-time-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  direction: rtl;
}

.pdp-time-label {
  font-size: 12px;
  color: #6c757d;
  margin: 0 4px;
}

.pdp-time-input {
  width: 48px;
  text-align: center;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 4px;
  font-size: 13px;
  direction: ltr;
}

  .pdp-time-input:focus {
    outline: none;
    border-color: #2c9c5f;
    box-shadow: 0 0 0 2px rgba(44, 156, 95, 0.15);
  }

.pdp-time-separator {
  font-size: 14px;
  font-weight: 600;
  color: #495057;
}

/* ---------- Footer Buttons ---------- */
.pdp-footer {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  background: #ffffff;
  border-top: 1px solid #e9ecef;
  gap: 6px;
}

.pdp-footer-btn {
  flex: 1;
  padding: 6px 12px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: #ffffff;
  color: #495057;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

  .pdp-footer-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
  }

  .pdp-footer-btn.pdp-btn-primary {
    background: #2c9c5f;
    color: #ffffff;
    border-color: #2c9c5f;
  }

    .pdp-footer-btn.pdp-btn-primary:hover {
      background: #1d7d46;
      border-color: #1d7d46;
    }

  .pdp-footer-btn.pdp-btn-danger {
    color: #dc3545;
    border-color: #f5c2c7;
  }

    .pdp-footer-btn.pdp-btn-danger:hover {
      background: #fff5f5;
    }

/* ---------- Input Styling ---------- */
input.persian-date-picker {
  direction: rtl;
  text-align: right;
  cursor: pointer;
}

  input.persian-date-picker:focus {
    border-color: #2c9c5f;
    box-shadow: 0 0 0 2px rgba(44, 156, 95, 0.15);
  }

/* ---------- Overlay (for closing on outside click) ---------- */
.pdp-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99998;
  background: transparent;
  display: none;
}

  .pdp-overlay.pdp-show {
    display: block;
  }

/* ---------- Mobile Responsive ---------- */
@media (max-width: 768px) {
  .pdp-calendar-container {
    width: 300px;
    font-size: 13px;
  }

  .pdp-day {
    min-height: 34px;
    font-size: 12px;
  }

  .pdp-header {
    padding: 10px 12px;
  }

  .pdp-nav-btn {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 480px) {
  .pdp-calendar-container {
    width: calc(100vw - 24px);
    left: 12px !important;
    right: 12px !important;
  }

  .pdp-day {
    min-height: 40px;
    font-size: 14px;
  }

  .pdp-footer {
    flex-wrap: wrap;
  }

  .pdp-footer-btn {
    flex: 1 1 calc(50% - 3px);
  }
}

/* ---------- Dark mode support (optional) ---------- */
@media (prefers-color-scheme: dark) {
  .pdp-calendar-container {
    background: #1e1e2e;
    border-color: #383850;
    color: #e0e0e8;
  }

  .pdp-selector-row {
    background: #252535;
    border-color: #383850;
  }

  .pdp-month-select,
  .pdp-year-select {
    background: #2a2a3a;
    color: #e0e0e8;
    border-color: #444460;
  }

  .pdp-weekdays {
    background: #1e1e2e;
  }

  .pdp-weekday {
    color: #9090a0;
  }

  .pdp-days {
    background: #1e1e2e;
  }

  .pdp-day {
    background: #2a2a3a;
    color: #c0c0d0;
  }

    .pdp-day:hover {
      background: #2c9c5f33;
      color: #5cd49a;
    }

    .pdp-day.pdp-other-month {
      color: #555570;
      background: transparent;
    }

  .pdp-time-section {
    background: #252535;
    border-color: #383850;
  }

  .pdp-time-input {
    background: #2a2a3a;
    color: #e0e0e8;
    border-color: #444460;
  }

  .pdp-footer {
    background: #1e1e2e;
    border-color: #383850;
  }

  .pdp-footer-btn {
    background: #2a2a3a;
    color: #c0c0d0;
    border-color: #444460;
  }
}
