/*
    Author: Nigus Abate
    Email: abatenigus0@gmail.com
    Website: devethio.com
*/

/* Main input styling */
.datepicker {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    width: 200px;
    background-color: #fff;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></rect></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 35px;
}

.datepicker:focus {
    outline: none;
    border-color: #4d90fe;
    box-shadow: 0 0 0 2px rgba(77, 144, 254, 0.2);
}

/* Modal styling */
.adp-modal {
    position: absolute;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    padding: 15px;
    z-index: 1000;
    display: none;
    width: 300px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.adp-modal.show {
    display: block;
    animation: adp-fadeIn 0.15s ease-out;
}

@keyframes adp-fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .adp-modal {
    width: 100%;
    left: 0 !important;
    top: auto !important;
    bottom: 0;
    border-radius: 8px 8px 0 0;
  }
}

/* Header styling */
.adp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.adp-header select {
    appearance: none;
    padding: 6px 25px 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    background-color: #fff;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    cursor: pointer;
    margin-right: 5px;
}

.adp-header select:focus {
    outline: none;
    border-color: #4d90fe;
}

.adp-month-select {
    width: 120px;
}

.adp-year-select {
    width: 90px;
}

/* Weekdays styling */
.adp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 13px;
}

/* Days grid styling */
.adp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.adp-day {
    padding: 8px 0;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.adp-day:hover {
    background-color: #f0f0f0;
}

.adp-day:focus {
    outline: 2px solid #4d90fe;
    outline-offset: -2px;
}

.adp-day.selected {
    background-color: #4d90fe;
    color: white;
    font-weight: 500;
}

.adp-day.today {
    background-color: #e6f2ff;
    font-weight: bold;
}

.adp-day.other-month {
    color: #ccc;
}

.adp-day.disabled {
    color: #ddd;
    cursor: not-allowed;
    background-color: #f9f9f9;
}

/* Range selection styles */
.adp-day.range {
    background-color: #e6f2ff;
    border-radius: 0;
}

.adp-day.range-start {
    background-color: #4d90fe;
    color: white;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.adp-day.range-end {
    background-color: #4d90fe;
    color: white;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* Footer styling */
.adp-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    gap: 8px;
}

.adp-footer-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background-color: #f8f8f8;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.adp-footer-btn:hover {
    background-color: #e8e8e8;
}

.adp-footer-btn.primary {
    background-color: #4d90fe;
    color: white;
    border-color: #3a7bd5;
}

.adp-footer-btn.primary:hover {
    background-color: #3a7bd5;
}

/* Accessibility improvements */
.adp-day[aria-selected="true"] {
    background-color: #4d90fe;
    color: white;
}

.adp-day[aria-current="date"] {
    background-color: #e6f2ff;
    font-weight: bold;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}