/* Persian Date Picker Styles */

.persian-datepicker-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.persian-calendar {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 15px;
    margin-top: 5px;
    font-family: 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
}

.persian-calendar button {
    border: none;
    background: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.persian-calendar button:hover {
    background-color: #f0f0f0;
}

.persian-calendar .calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.persian-calendar .calendar-title {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.persian-calendar .day-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 10px;
}

.persian-calendar .day-header {
    text-align: center;
    font-weight: bold;
    font-size: 12px;
    padding: 8px 4px;
    color: #666;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.persian-calendar .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.persian-calendar .day-cell {
    padding: 10px 4px;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.persian-calendar .day-cell:hover {
    background-color: #e3f2fd;
    color: #1976d2;
}

.persian-calendar .day-cell.selected {
    background-color: #1976d2;
    color: white;
    font-weight: bold;
}

.persian-calendar .day-cell.today {
    background-color: #fff3e0;
    color: #f57c00;
    font-weight: bold;
}

.persian-calendar .day-cell.other-month {
    color: #ccc;
    cursor: not-allowed;
}

.persian-calendar .day-cell.other-month:hover {
    background-color: transparent;
    color: #ccc;
}

/* RTL Support */
.persian-datepicker-container input {
    direction: rtl;
    text-align: right;
}

/* Form integration */
.form-control.persian-datepicker {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M6 2L6 6M14 2L14 6M5 10L15 10M4 2H16C17.1046 2 18 2.89543 18 4V16C18 17.1046 17.1046 18 16 18H4C2.89543 18 2 17.1046 2 16V4C2 2.89543 2.89543 2 4 2Z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 16px;
    padding-left: 40px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .persian-calendar {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .persian-calendar .day-header {
        background-color: #4a5568;
        color: #e2e8f0;
    }
    
    .persian-calendar .day-cell:hover {
        background-color: #4a5568;
        color: #e2e8f0;
    }
    
    .persian-calendar .day-cell.selected {
        background-color: #3182ce;
        color: white;
    }
    
    .persian-calendar .day-cell.today {
        background-color: #744210;
        color: #fbd38d;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .persian-calendar {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 350px;
        z-index: 9999;
    }
    
    .persian-calendar .day-cell {
        padding: 8px 2px;
        font-size: 12px;
        min-height: 30px;
    }
    
    .persian-calendar .day-header {
        padding: 6px 2px;
        font-size: 11px;
    }
}
