/* cal.css */
.cal-container :root {
    --white-bg: #FFFFFF;
    --light-gray: #F5F5F5;
    --text-dark: #333333;
    --text-white: #FFFFFF;
    --medium-blue: #4682B4;
    --blue-hover: #5A9BD4;
    --light-blue: #B0C4DE;
    --shadow: rgba(0, 0, 0, 0.1);
    --pastel-green: #98FB98;
    --forest-green: #228B22;
    --cancel-light: #87CEEB;
    --deep-shadow: rgba(0, 0, 0, 0.3);
}

.cal-container body {
    font-family: var(--font-family, 'Poppins', sans-serif);
    margin: 0;
    padding: 0;
    background: var(--white-bg);
    color: var(--text-dark);
    font-size: var(--base-font-size, 1rem);
}

.cal-container .container {
    width: 90%;
    margin: 0 auto;
    padding: 3% 2%;
}

.cal-container header {
    background: var(--light-gray);
    text-align: center;
    padding: 3% 2%;
    border-bottom: 1px solid var(--shadow);
}

.cal-container h1 {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 1%;
}

.cal-container h2 {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 2%;
}

.cal-container h3 {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1.2rem;
    margin: 0 0 2%;
}

.cal-container p {
    color: var(--text-dark);
    font-size: 1rem;
    margin-bottom: 2%;
}

.cal-container .button {
    padding: 1% 2%;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.1s ease;
    background: var(--medium-blue);
    color: var(--text-white);
}

.cal-container .button:hover {
    background: var(--blue-hover);
    transform: scale(1.05);
}

.cal-container .button:active {
    transform: scale(0.95);
}

.cal-container .button:disabled {
    background: #CCCCCC;
    cursor: not-allowed;
    opacity: 0.7;
}

.cal-container .button.primary,
.cal-container .button.navy {
    background: var(--medium-blue);
}

.cal-container .button.primary:hover,
.cal-container .button.navy:hover {
    background: var(--blue-hover);
}

.cal-container .button.cancel {
    background: var(--cancel-light);
}

.cal-container .button.cancel:hover {
    background: #ADD8E6;
}

.cal-container .modal {
    display: none;
    position: fixed;
    z-index: var(--modal-z-index, 1000);
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--modal-transition-duration, 0.3s) ease;
}

.cal-container .modal.visible {
    opacity: 1;
}

.cal-container .modal-content {
    background: rgba(255, 255, 255, 0.9);
    padding: 1.5%;
    width: var(--modal-width, 400px);
    border-radius: 12px;
    box-shadow: 0 6px 20px var(--deep-shadow);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    padding-top: 50px;
}

.cal-container .modal-content::after {
    content: '';
    display: block;
    width: 90%;
    height: 2px;
    background: radial-gradient(circle, var(--medium-blue), var(--light-blue), transparent);
    position: absolute;
    top: 40px;
    left: 5%;
}

.cal-container .time-picker-modal-content {
    background: var(--white-bg);
    text-align: center;
    padding: 3%;
    border-radius: 12px;
    width: auto;
    box-shadow: 0 6px 20px var(--deep-shadow);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 50px;
}

.cal-container .time-picker-modal-content::after {
    content: '';
    display: block;
    width: 90%;
    height: 2px;
    background: radial-gradient(circle, var(--medium-blue), var(--light-blue), transparent);
    position: absolute;
    top: 40px;
    left: 5%;
}

.cal-container .time-picker-modal-content h2 {
    font-size: 1.5rem;
    margin: 0;
}

.cal-container .time-picker-modal-content h3 {
    font-size: 2rem;
    margin: 0;
}

.cal-container .time-picker-modal-content select {
    width: auto;
    padding: 1%;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--white-bg);
    color: var(--text-dark);
    transition: opacity 0.3s ease;
    margin: 0 auto;
}

.cal-container .time-picker-modal-content .time-range {
    font-size: var(--time-range-font-size, 1.6rem);
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    position: absolute;
    white-space: nowrap;
    text-align: center;
}

.cal-container .time-picker-actions {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin: 0;
}

.cal-container .time-picker-actions .button {
    width: 80px;
    padding: 1% 2%;
}

.cal-container .modal-close {
    position: absolute;
    top: 2%;
    right: 3%;
    font-size: 1.5rem;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
}

.cal-container .modal-close:hover {
    color: var(--medium-blue);
}

.cal-container #cal-modal .modal-close {
    right: 0.5%;
    top: 0.5%;
}

.cal-container .calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2%;
}

.cal-container #current-month {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.cal-container .cal-nav {
    background: var(--medium-blue);
    color: var(--text-white);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cal-container .cal-nav:disabled {
    background: #CCCCCC;
    cursor: not-allowed;
    opacity: 0.7;
}

.cal-container .cal-nav:hover:not(:disabled) {
    background: var(--blue-hover);
}

.cal-container .calendar-container {
    overflow: hidden;
    position: relative;
    background: var(--white-bg);
    border-radius: 4px;
    padding: 1%;
    border: 1px solid var(--light-gray);
}

.cal-container .calendar-slider {
    display: flex;
    transition: transform var(--cal-slide-duration, 0.5s) ease;
    width: 200%;
}

.cal-container .calendar-month {
    min-width: 50%;
    flex-shrink: 0;
}

.cal-container .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: auto repeat(6, 1fr);
    gap: 0.5%;
    text-align: center;
    user-select: none;
    height: var(--cal-height, 50vh);
}

.cal-container .calendar-day {
    padding: 2px;
    border-radius: 4px;
    transition: background 0.2s;
    color: var(--text-dark);
    background: var(--light-gray);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
}

.cal-container .calendar-day.unselectable {
    background: #E0E0E0;
    color: #999999;
    cursor: not-allowed;
}

.cal-container .calendar-day.selectable {
    cursor: pointer;
}

.cal-container .calendar-day.selectable:hover {
    background: var(--light-blue);
}

.cal-container .calendar-day.selected {
    color: var(--text-dark);
}

.cal-container .calendar-day.confirmed {
    background: var(--pastel-green);
    color: var(--forest-green);
    cursor: pointer;
    font-weight: 700;
}

.cal-container .calendar-day span.date-number {
    font-size: 0.8rem;
    margin: 2px 4px 0 0;
}

.cal-container .calendar-day span.time {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.cal-container .calendar-day-header {
    font-weight: 600;
    padding: 2px;
    line-height: 1.2;
    color: var(--text-white);
    background: var(--medium-blue);
    border-radius: 4px;
}

.cal-container .calendar-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2%;
}

.cal-container .summary-glass {
    margin-bottom: 2%;
    padding: 2%;
    background: var(--light-gray);
    border-radius: 4px;
    border: 1px solid var(--shadow);
    display: flex;
    justify-content: flex-end;
}

.cal-container .appointment-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border: none;
    position: relative;
}

.cal-container .appointment-list::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: radial-gradient(circle, var(--forest-green), transparent);
    position: absolute;
    bottom: -2px;
}

.cal-container .appointment-list li {
    background: var(--pastel-green);
    color: var(--text-white);
    font-size: 1.2rem;
    font-weight: 700;
    padding: 8px;
    text-align: center;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.cal-container .appointment-list li:not(:last-child) {
    border-bottom: 2px solid transparent;
    border-image: radial-gradient(circle, var(--forest-green), transparent) 1;
}

.cal-container .appointment-list li img.check-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
}

.cal-container .form-group {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    margin-bottom: 2%;
}

.cal-container .form-group label {
    margin-right: 2%;
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    padding-top: 1%;
}

.cal-container .form-group input,
.cal-container .form-group textarea {
    width: 70%;
    padding: 1%;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    font-size: 1rem;
    background: var(--white-bg);
    color: var(--text-dark);
}

.cal-container .form-group textarea {
    resize: vertical;
}

.cal-container .form-group input:focus,
.cal-container .form-group textarea:focus {
    border-color: var(--medium-blue);
    outline: none;
}

.cal-container .inquiry-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 4%;
}

.cal-container .inquiry-buttons .button {
    width: 48%;
}

.cal-container .success-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.cal-container .success-icon {
    width: 0;
    height: 0;
    opacity: 0;
    animation: zoomSpin var(--success-icon-animation-duration, 0.8s) ease forwards;
}

@keyframes zoomSpin {
    0% {
        width: 0;
        height: 0;
        opacity: 0;
        transform: rotate(0deg);
    }
    100% {
        width: var(--success-icon-size, 48px);
        height: var(--success-icon-size, 48px);
        opacity: 1;
        transform: rotate(360deg);
    }
}
