.ui-datepicker {
    z-index: 9999 !important;
    background-color: white !important;
}

#dental-reservation-system {
        max-width: 800px;
        margin: 0 auto;
        padding: 20px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    #dental-reservation-system h2 {
        text-align: center;
        margin-bottom: 30px;
        color: #2c3e50;
        font-size: 26px;
        border-bottom: 3px solid #4caf50;
        padding-bottom: 15px;
    }
    .calendar-legend-frontend {
        background: #f8f9fa;
        padding: 20px;
        border-radius: 6px;
        margin-bottom: 30px;
        border: 1px solid #e0e0e0;
    }
    .calendar-legend-frontend h3 {
        margin: 0 0 15px 0;
        font-size: 17px;
        color: #2c3e50;
        border-bottom: 2px solid #4caf50;
        padding-bottom: 10px;
    }
    .legend-items {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 12px;
    }
    .legend-item {
        display: flex;
        align-items: center;
        font-size: 14px;
        padding: 5px;
        background: #fff;
        border-radius: 4px;
    }
    .legend-box {
        display: inline-block;
        width: 24px;
        height: 24px;
        margin-right: 10px;
        border-radius: 4px;
        flex-shrink: 0;
    }
    .legend-complete-closed { background-color: #dc3545; }
    .legend-morning-closed { background-color: #ffc107; }
    .legend-afternoon-closed { background-color: #17a2b8; }
    .legend-sunday { background-color: #ffcccc; }
    .form-group {
        margin-bottom: 25px;
    }
    .form-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
        color: #2c3e50;
        font-size: 15px;
    }
    .form-group input, .form-group select, .form-group textarea {
        width: 100%;
        padding: 12px 15px;
        border: 2px solid #e0e0e0;
        border-radius: 6px;
        font-size: 15px;
        transition: border-color 0.3s, box-shadow 0.3s;
        box-sizing: border-box;
    }
    .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
        outline: none;
        border-color: #4caf50;
        box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
    }
    .form-group textarea {
        resize: vertical;
        min-height: 120px;
        font-family: inherit;
    }
    .required {
        color: #dc3545;
        font-weight: bold;
    }
    .description {
        color: #6c757d;
        font-size: 13px;
        margin-top: 6px;
        line-height: 1.5;
    }
    .time-info {
        background: #fff3cd;
        border: 1px solid #ffc107;
        padding: 10px;
        border-radius: 4px;
        color: #856404;
        font-weight: 500;
    }
    .form-submit {
        text-align: center;
        margin-top: 35px;
        padding-top: 25px;
        border-top: 1px solid #e0e0e0;
    }
    .form-submit input, .button {
        padding: 15px 50px;
        background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
        color: white;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        font-size: 17px;
        font-weight: bold;
        transition: transform 0.2s, box-shadow 0.2s;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        text-decoration: none;
        display: inline-block;
    }
    .form-submit input:hover, .button:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    }
    .form-submit input:active, .button:active {
        transform: translateY(0);
    }
    .dental-error {
        background: #fee;
        color: #c33;
        padding: 18px 20px;
        border-left: 5px solid #dc3545;
        margin-bottom: 25px;
        border-radius: 6px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    .dental-error p {
        margin: 0 0 10px 0;
        font-weight: 600;
    }
    .dental-error ul {
        margin: 10px 0 0 20px;
        padding: 0;
    }
    .dental-error li {
        margin-bottom: 6px;
    }
    .dental-success {
        background: #d4edda;
        color: #155724;
        padding: 20px;
        border-left: 5px solid #4caf50;
        margin-bottom: 25px;
        border-radius: 6px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    .dental-success p {
        margin: 0 0 10px 0;
    }
    .dental-success p:last-child {
        margin-bottom: 0;
    }
    .reservation-details {
        background: #fff;
        padding: 15px;
        border-radius: 4px;
        margin-top: 15px;
        border: 1px solid #c3e6cb;
    }
    .reservation-details p {
        margin: 8px 0;
        font-size: 15px;
    }
    /* DatepickerのカスタムCSS - 直接inputに適用する場合 */
    .ui-datepicker {
        width: 100% !important;
        max-width: 350px;
        font-size: 14px;
        padding: 10px;
        border-radius: 6px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }
    .ui-datepicker-header {
        background: #4caf50;
        color: white;
        border-radius: 4px;
        padding: 10px;
    }
    .ui-datepicker-title {
        color: white;
        font-weight: bold;
    }
    .ui-datepicker-prev, .ui-datepicker-next {
        cursor: pointer;
    }
    .ui-datepicker-calendar {
        width: 100%;
        margin-top: 10px;
    }
    .ui-datepicker-calendar th {
        background: #f0f0f0;
        font-weight: bold;
        padding: 10px 5px;
        text-align: center;
    }
    .ui-datepicker-calendar td {
        text-align: center;
        padding: 5px;
    }
    .ui-datepicker-calendar td a {
        display: block;
        padding: 8px;
        text-decoration: none;
        border-radius: 4px;
        transition: all 0.2s;
    }
    .ui-datepicker-calendar td a:hover {
        transform: scale(1.1);
    }
    .ui-datepicker .closed-day a {
        background-color: #dc3545 !important;
        color: #fff !important;
        font-weight: bold;
        cursor: not-allowed;
        pointer-events: none;
    }
    .ui-datepicker .sunday a {
        background-color: #ffcccc !important;
        color: #dc3545 !important;
        font-weight: bold;
        cursor: not-allowed;
        pointer-events: none;
    }
    .ui-datepicker .morning-closed a {
        background-color: #ffc107 !important;
        color: #000 !important;
        font-weight: bold;
    }
    .ui-datepicker .afternoon-closed a {
        background-color: #17a2b8 !important;
        color: #fff !important;
        font-weight: bold;
    }
    .ui-datepicker .ui-state-disabled {
        opacity: 0.5;
    }
    @media (max-width: 768px) {
        #dental-reservation-system {
            padding: 15px;
            margin: 10px;
        }
        #dental-reservation-system h2 {
            font-size: 22px;
        }
        .legend-items {
            grid-template-columns: 1fr;
        }
        .form-submit input, .button {
            padding: 12px 30px;
            font-size: 16px;
        }
    }