/* Accessible date range picker CSS
   Styles for accessible date range selection UI, including focus, contrast, and responsive support
   Sections are commented for clarity (container, calendar, buttons, etc.)
 */

/* --- Material Angular-inspired Enhancements --- */

/* Container Elevation & Rounded Corners */
.drp-container, .adrp-dropdown-menu {
    box-shadow: 0 4px 20px rgba(60, 60, 60, 0.18), 0 1.5px 4px rgba(60, 60, 60, 0.10);
    border-radius: 12px;
    border-width: 1.5px;
}

/* Inputs */
.drp-input, .adrp-dropdown-menu .form-control {
    border: 1.5px solid #cfd8dc;
    background: #fafbfc;
    color: #1C1F22;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.drp-input:focus, .adrp-dropdown-menu .form-control:focus {
border-color: #ffc107;
  box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, .15);
  outline: 0;
}

/* Calendar Table */
.drp-calendar-table, .adrp-calendar table {
    border-spacing: 4px;
}
.drp-day-header, .adrp-calendar th {
    color: #656C70;
    font-weight: normal;
    padding-bottom: 10px;
    font-size: 14px;
    letter-spacing: 0.5px;
}

/* Date Cells */
.drp-date, .adrp-calendar td {
    transition: background 0.15s, color 0.15s;
}
.drp-date .drp-date-content, .adrp-calendar td {
    font-size: 14px;
    font-weight: 500;
    min-width: 36px;
    min-height: 36px;
    padding: 8px;
}
.drp-date:not(.drp-disabled):hover .drp-date-content, .adrp-calendar td:not(.drp-disabled):hover {
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 6px;
}
.drp-date.drp-today .drp-date-content, .adrp-calendar .today {
    border: 1.5px solid #1976d2;
    background: #e3f2fd;
    color: #1976d2;
}
.drp-date.drp-focused .drp-date-content, .adrp-calendar td[tabindex="0"]:focus {
    box-shadow: 0 0 0 2px #90caf9;
    background: #e3f2fd;
    color: #1976d2;
}
.drp-date.drp-start .drp-date-content, .drp-date.drp-end .drp-date-content, .adrp-calendar .selected {
    background: #1976d2;
    color: #fff;
}
.drp-date.drp-in-range .drp-date-content, .adrp-calendar .in-range {
    background: #EFEFEF;
    color: #333;
}
.drp-date.drp-disabled, .adrp-calendar .drp-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Navigation Buttons */
.drp-nav {
    border-radius: 50%;
    background: none;
    border: none;
    color: #1976d2;
    width: 36px;
    height: 36px;
    transition: background 0.15s;
}
.drp-nav:hover, .drp-nav:focus {
    background: #e3f2fd;
    color: #1565c0;
    outline: none;
}


/* Range highlight with rounded ends */
.drp-date.drp-in-range:not(.drp-start):not(.drp-end) .drp-date-content {
    border-radius: 0;
}
.drp-date.drp-start .drp-date-content {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}
.drp-date.drp-end .drp-date-content {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* Responsive tweaks for mobile */
@media (max-width: 480px) {
    .drp-container {
        border-radius: 8px;
        min-width: 0;
        max-width: 100vw;
    }
    .drp-calendar-table, .adrp-calendar table {
        font-size: 13px;
    }
}

/* --- End Material Angular-inspired Enhancements --- */

/* Container */
.drp-container {
    position: absolute;
    background: #ffffff;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    z-index: 9999;
    min-width: 350px;
    max-width: 450px;
}

/* Header */
.drp-header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 6px 6px 0 0;
}

.drp-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.drp-inputs {
    display: flex;
    gap: 12px;
}

.drp-input-group {
    flex: 1;
}

.drp-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #374151;
    font-size: 13px;
}

.drp-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    background: #ffffff;
    color: #111827;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.drp-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.drp-help {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
    line-height: 1.3;
}

/* Calendar Container */
.drp-calendar-container {
    padding: 16px;
}

.drp-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.drp-nav {
    background: none;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #374151;
    transition: all 0.15s ease-in-out;
}

.drp-nav:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.drp-nav:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.drp-nav:active {
    background: #e5e7eb;
}

.drp-month-year {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    text-align: center;
    flex: 1;
}

/* Calendar Table */
.drp-calendar-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
}

.drp-day-header {
    padding: 8px 4px;
    text-align: center;
    font-weight: 600;
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.drp-date {
    width: 40px;
    height: 40px;
    text-align: center;
    vertical-align: middle;
    position: relative;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease-in-out;
}

.drp-date-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.drp-date:not(.drp-disabled) {
    color: #111827;
}

.drp-date.drp-other-month .drp-date-content {
    color: #9ca3af;
}

.drp-date.drp-today .drp-date-content {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}

.drp-date:not(.drp-disabled):hover .drp-date-content {
    background: #f3f4f6;
    color: #111827;
}

.drp-date.drp-focused .drp-date-content {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
    background: #eff6ff;
}

.drp-date.drp-start .drp-date-content,
.drp-date.drp-end .drp-date-content {
    background: #3b82f6;
    color: #ffffff;
    font-weight: 600;
}

.drp-date.drp-in-range .drp-date-content {
    background: #dbeafe;
    color: #1e40af;
}

.drp-date.drp-disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.drp-date.drp-disabled .drp-date-content {
    color: #9ca3af;
}

/* Footer */
.drp-footer {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 6px 6px;
}

.drp-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.drp-btn {
    padding: 8px 16px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    background: #ffffff;
    color: #374151;
}

.drp-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.drp-btn:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.drp-btn:active {
    background: #e5e7eb;
}

.drp-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    background: #f9fafb;
    color: #9ca3af;
}

.drp-btn.drp-primary {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.drp-btn.drp-primary:hover:not(:disabled) {
    background: #2563eb;
    border-color: #2563eb;
}

.drp-btn.drp-primary:active:not(:disabled) {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

/* Accessible Date Range Picker CSS for jQuery plugin */
.adrp-dropdown-menu {
  min-width: 320px;
  padding: 1rem;
  position: absolute;
  background: #fff;
  border: 1px solid #D1D6D8;
  border-radius: 4px;
  z-index: 9999;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}
.adrp-calendar {
  text-align: center;
}
.adrp-calendar .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 15px 0;
}
.adrp-calendar table {
  width: 100%;
}
.adrp-calendar th, .adrp-calendar td {
  width: 14.28%;
  text-align: center;
}
.adrp-calendar .selected, .adrp-calendar .selected:focus, .adrp-calendar .selected:hover, .adrp-calendar .selected:active {
  background-color: #ffc107 !important;
  font-weight: bold;
  color: #000000 !important;
  outline: 1px solid #ffc107;
}
.adrp-calendar .selected.selected-from{
  border-radius: 6px 0 0 6px;
}
.adrp-calendar .selected.selected-to{
  border-radius: 0 6px 6px 0;
}
.adrp-calendar .in-range {
  background-color: #EFEFEF;
}
.adrp-action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}
.adrp-calendar td[tabindex="0"]:focus, .adrp-calendar td[tabindex="0"].focus {
  outline: 2px solid #000000;
  box-shadow: none;
  background-color: #EFEFEF;
  color: #000000;
  z-index: 2;
  position: relative;
}
.adrp-calendar button:focus, .adrp-calendar button.focus {
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
  z-index: 2;
  position: relative;
}
.adrp-dropdown-menu .form-control {
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
  box-shadow: none;
}
.adrp-dropdown-menu .form-control:focus {
  color: #212529;
  background-color: #fff;
border-color: #ffc107;
  box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, .15);
  outline: 0;
}
.adrp-dropdown-menu .form-control[readonly] {
  background-color: #e9ecef;
  opacity: 1;
  cursor: default;
}
.adrp-dropdown-menu .form-control:disabled {
  background-color: #e9ecef;
  opacity: 1;
  cursor: not-allowed;
}
.adrp-input-error {
  border-color: #e53935 !important;
  box-shadow: 0 0 0 2px #ffcdd2 !important;
  background: #fff8f8 !important;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .drp-container {
        border: 3px solid #000000;
    }
    
    .drp-input:focus {
        border-color: #000000;
        box-shadow: 0 0 0 3px #ffff00;
    }
    
    .drp-nav:focus,
    .drp-btn:focus {
        border-color: #000000;
        box-shadow: 0 0 0 3px #ffff00;
    }
    
    .drp-date.drp-focused .drp-date-content {
        box-shadow: 0 0 0 3px #ffff00;
        background: #ffff00;
        color: #000000;
    }
    
    .drp-date.drp-start .drp-date-content,
    .drp-date.drp-end .drp-date-content {
        background: #000000;
        color: #ffffff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .drp-input,
    .drp-nav,
    .drp-date,
    .drp-date-content,
    .drp-btn {
        transition: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .drp-container {
        background: #1f2937;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .drp-header,
    .drp-footer {
        background: #111827;
        border-color: #374151;
    }
    
    .drp-title {
        color: #f9fafb;
    }
    
    .drp-label {
        color: #d1d5db;
    }
    
    .drp-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .drp-input:focus {
        border-color: #60a5fa;
    }
    
    .drp-nav {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }
    
    .drp-nav:hover {
        background: #4b5563;
    }
    
    .drp-month-year {
        color: #f9fafb;
    }
    
    .drp-day-header {
        color: #9ca3af;
    }
    
    .drp-date:not(.drp-disabled) {
        color: #f9fafb;
    }
    
    .drp-date:not(.drp-disabled):hover .drp-date-content {
        background: #4b5563;
    }
    
    .drp-date.drp-today .drp-date-content {
        background: #1e3a8a;
        color: #93c5fd;
    }
    
    .drp-btn {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }
    
    .drp-btn:hover {
        background: #4b5563;
    }
    
    .drp-btn.drp-primary {
        background: #2563eb;
        border-color: #2563eb;
    }
}

/* Screen Reader Only Content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus trap helper */
.drp-container[aria-modal="true"] {
    position: fixed;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .drp-container {
        min-width: 320px;
        max-width: calc(100vw - 20px);
    }
    
    .drp-inputs {
        flex-direction: column;
        gap: 8px;
    }
    
    .drp-buttons {
        flex-direction: column;
    }
    
    .drp-btn {
        width: 100%;
    }
}

.adrp-prev-year, .adrp-next-month, .adrp-prev-month, .adrp-next-year {
    border: 0;
    box-shadow: none;
}

.adrp-month-label {
    color: #1C1F22;
    font-weight: 700;
}
.adrp-calendar thead {
    border-bottom: 1px solid #BFC4C8;
}
.adrp-calendar td.adrp-today {
  position: relative;
}
.adrp-calendar td.adrp-today::before {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    background: #000000;
    border-radius: 2.5px;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
}

/* Input fileds place-holder text */
.placeholder-text{
     color: #5f5f5f;
     opacity: 1;
}
.placeholder-text::placeholder{
     color: #5f5f5f;
     opacity: 1;
}
