/* ========================================
   CUSTOM DATEPICKER — AutoLoc
   Modern, premium date/datetime picker
   ======================================== */

/* Wrapper */
.alp-wrapper {
    position: relative;
    width: 100%;
}

/* Trigger (the visible input) */
.alp-trigger {
    width: 100%;
    cursor: pointer !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    padding-right: 42px !important;
}
.alp-trigger:focus {
    border-color: var(--primary, #3b82f6) !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12) !important;
}
.alp-trigger::placeholder {
    color: #94a3b8;
}

/* Dropdown Panel */
.alp-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 9999;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 20px 60px -12px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.03);
    padding: 0;
    min-width: 310px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
}
.alp-dropdown.alp-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
/* Flip upward animation direction */
.alp-dropdown.alp-flip {
    transform: translateY(8px) scale(0.97);
}
.alp-dropdown.alp-flip.alp-open {
    transform: translateY(0) scale(1);
}

/* Header (month nav) */
.alp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    background: linear-gradient(135deg, var(--primary, #3b82f6), #6366f1);
}
.alp-header-title {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    cursor: default;
    user-select: none;
    text-transform: capitalize;
}
.alp-nav-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 1rem;
    line-height: 1;
}
.alp-nav-btn:hover {
    background: rgba(255,255,255,0.35);
}
.alp-nav-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Weekday headers */
.alp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 10px 14px 4px;
    gap: 0;
}
.alp-weekday {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 0;
}

/* Days grid */
.alp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 4px 14px 14px;
    gap: 3px;
}
.alp-day {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1e293b;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all 0.15s ease;
    position: relative;
    font-family: inherit;
}
.alp-day:hover:not(.alp-disabled):not(.alp-empty):not(.alp-selected) {
    background: #f1f5f9;
    color: var(--primary, #3b82f6);
}
.alp-day.alp-today:not(.alp-selected) {
    font-weight: 800;
    color: var(--primary, #3b82f6);
    background: rgba(59,130,246,0.08);
}
.alp-day.alp-selected {
    background: var(--primary, #3b82f6);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 12px -2px rgba(59,130,246,0.4);
}
.alp-day.alp-disabled {
    color: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.5;
}
.alp-day.alp-empty {
    visibility: hidden;
    cursor: default;
}
.alp-day.alp-other-month {
    color: #cbd5e1;
}

/* Time picker section */
.alp-time-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px 16px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
}
.alp-time-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    margin-right: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.alp-time-label svg {
    width: 14px;
    height: 14px;
    stroke: #64748b;
    fill: none;
    stroke-width: 2;
}
.alp-time-input {
    width: 52px;
    text-align: center;
    padding: 8px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    background: #ffffff;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: textfield;
}
.alp-time-input::-webkit-outer-spin-button,
.alp-time-input::-webkit-inner-spin-button {
    appearance: none;
    margin: 0;
}
.alp-time-input:focus {
    border-color: var(--primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.alp-time-sep {
    font-size: 1.1rem;
    font-weight: 800;
    color: #94a3b8;
}

/* Footer with quick actions */
.alp-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px 14px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    border-radius: 0 0 16px 16px;
}
.alp-footer-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}
.alp-btn-today {
    background: transparent;
    color: var(--primary, #3b82f6);
}
.alp-btn-today:hover {
    background: rgba(59,130,246,0.08);
}
.alp-btn-clear {
    background: transparent;
    color: #94a3b8;
}
.alp-btn-clear:hover {
    background: #f1f5f9;
    color: #64748b;
}
.alp-btn-confirm {
    background: var(--primary, #3b82f6);
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px -2px rgba(59,130,246,0.3);
}
.alp-btn-confirm:hover {
    box-shadow: 0 6px 16px -2px rgba(59,130,246,0.4);
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 380px) {
    .alp-dropdown {
        min-width: 280px;
        left: 50%;
        transform: translateX(-50%) translateY(-8px) scale(0.97);
    }
    .alp-dropdown.alp-open {
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* Clickable title (year selector toggle) */
.alp-title-clickable {
    cursor: pointer !important;
    border-radius: 8px;
    padding: 4px 10px;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.alp-title-clickable:hover {
    background: rgba(255,255,255,0.2);
}

/* Years grid */
.alp-years-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 14px;
}
.alp-year-btn {
    padding: 10px 4px;
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: #1e293b;
    font-family: inherit;
    transition: all 0.15s ease;
    text-align: center;
}
.alp-year-btn:hover:not(.alp-year-selected) {
    background: #f1f5f9;
    color: var(--primary, #3b82f6);
}
.alp-year-btn.alp-year-current:not(.alp-year-selected) {
    font-weight: 800;
    color: var(--primary, #3b82f6);
    background: rgba(59,130,246,0.08);
}
.alp-year-btn.alp-year-selected {
    background: var(--primary, #3b82f6);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 12px -2px rgba(59,130,246,0.4);
}
