﻿/* thai-datepicker.css */
body {
    font-family: "Prompt", sans-serif;
}

.thai-datepicker {
    position: relative !important;
}

    .thai-datepicker input {
        width: 100%;
        cursor: pointer;
    }

.input-group.thai-datepicker {
    position: relative !important;
}

.calendar-container {
    position: absolute !important;
    top: calc(100% + 4px) !important;
    left: 0 !important;
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 280px;
    z-index: 9999 !important;
    padding: 0.75rem;
    animation: fadeIn 0.15s ease;
}

    .calendar-container.hidden {
        display: none;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

    .calendar-header select {
        padding: 0.25rem 0.5rem;
        border: 1px solid #d1d5db;
        border-radius: 0.25rem;
        font-size: 0.875rem;
        background-color: white;
        cursor: pointer;
    }

        .calendar-header select:focus {
            outline: none;
            border-color: #3b82f6;
        }

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #6b7280;
}

    .calendar-weekdays > div {
        padding: 0.25rem;
    }

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.875rem;
    gap: 2px;
}

    .calendar-days > div {
        padding: 0.5rem;
        cursor: pointer;
        border-radius: 9999px;
        transition: all 0.15s ease;
    }

        .calendar-days > div:not(:empty):hover {
            background-color: #e5e7eb;
        }

        .calendar-days > div.today {
            background-color: #dbeafe;
            color: #1e40af;
            font-weight: 600;
        }

        .calendar-days > div.selected {
            background-color: #3b82f6;
            color: white;
            font-weight: 600;
        }

.calendar-footer {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .calendar-footer button {
        padding: 0.25rem 0.75rem;
        font-size: 0.875rem;
        border: none;
        background: none;
        color: #3b82f6;
        cursor: pointer;
        border-radius: 0.25rem;
        transition: all 0.15s ease;
    }

        .calendar-footer button:hover {
            background-color: #dbeafe;
        }

/* Ensure calendar isn't clipped by containers */
.input-group,
.card,
.container,
.card-body {
    overflow: visible !important;
}

/* Make sure calendar appears above Bootstrap modals */
.modal-backdrop {
    z-index: 1040;
}

.modal {
    z-index: 1050;
}

.calendar-container {
    z-index: 9999 !important;
}
