/* استایل‌های مشترک برای فرانت‌اند و پنل مدیریت */
.calendar {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    direction: rtl; /* تنظیم جهت راست به چپ */
}
.month-header {
    text-align: center;
    font-size: 24px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
}
.nav-button:hover {
    background: #0056b3;
}
.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    padding: 10px 0;
    width: 100%;
    box-sizing: border-box;
}
.day-header {
    background: #f0f0f0;
    text-align: center;
    padding: 8px;
    font-weight: bold;
    border-radius: 4px;
}
.day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    border-radius: 8px;
    cursor: not-allowed;
    font-size: 12px;
    padding: 10px;
    box-sizing: border-box;
    min-height: 60px; /* ارتفاع ثابت برای سلول‌ها */
    position: relative; /* برای قرارگیری تولتیپ */
}
.day.empty {
    background: transparent;
    border: none;
}
.day.active {
    background: #007bff;
    color: white;
    cursor: pointer;
}
.day.active:hover {
    background: #0056b3;
}
.day.selected {
    background: #28a745;
}
/* استایل تولتیپ */
.day.active[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%; /* نمایش در بالای سلول */
    right: 50%;
    transform: translateX(50%);
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 5px;
}
.day.active[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%; /* فلش تولتیپ */
    right: 50%;
    transform: translateX(50%);
    border: 5px solid transparent;
    border-top-color: #333;
    margin-bottom: -5px;
}
/* استایل برای دکمه‌های عملیات در روزها */
.day-actions {
    position: absolute;
    top: 5px;
    left: 5px;
    display: none;
}
.day.active:hover .day-actions {
    display: block;
}
.day-actions a.delete-date {
    color: #fff;
    background: #dc3545;
    padding: 2px 5px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 10px;
}
.day-actions a.delete-date:hover {
    background: #c82333;
}
.time-slots {
    display: flex;
    gap: 5px;
    padding: 10px;
    flex-wrap: wrap;
    direction: rtl; /* تنظیم جهت راست به چپ */
}
.time-slot {
    padding: 8px 12px;
    background: #007bff;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}
.time-slot.disabled {
    background: #ccc;
    cursor: not-allowed;
}
.time-slot.selected {
    background: #28a745;
}
.form-container {
    max-width: 400px;
    margin: 10px auto;
    width: 100%;
    box-sizing: border-box;
}
form input, form button, form select {
    display: block;
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}
form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M5 7l5 5 5-5H5z"/></svg>') no-repeat left 10px center; /* فلش به سمت چپ */
    background-size: 12px;
    padding-left: 30px; /* فضای کافی برای فلش */
}
form button {
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
}
form button:hover {
    background: #0056b3;
}

/* استایل‌های پنل مدیریت */
.time-row {
    display: flex;
    gap: 5px;
    margin: 5px 0;
    flex-wrap: wrap;
}
.time-row input {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
}
form label {
    display: block;
    margin: 5px 0 3px;
}

/* Media Query برای موبایل */
@media (max-width: 600px) {
    .calendar {
        padding: 0;
        max-width: 100%;
    }
    .month-header {
        font-size: 16px;
        padding: 5px;
        flex-direction: column;
        gap: 5px;
    }
    .nav-button {
        padding: 5px 10px;
        font-size: 12px;
    }
    .days-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 3px;
        padding: 5px 0;
        width: 100%;
        max-width: 100%;
    }
    .day, .day-header {
        font-size: 10px;
        padding: 5px;
        min-height: 40px; /* ارتفاع کمتر برای موبایل */
    }
    .day.active[data-tooltip]:hover::after {
        font-size: 10px;
        padding: 3px 6px;
    }
    .day-actions a.delete-date {
        font-size: 8px;
        padding: 1px 3px;
    }
    .time-slots {
        gap: 3px;
        padding: 5px;
    }
    .time-slot {
        padding: 5px 8px;
        font-size: 10px;
    }
    .form-container {
        padding: 0;
        max-width: 100%;
    }
    .form input, form button, form select {
        padding: 5px;
        margin: 3px 0;
        font-size: 10px;
    }
}