/**
 * Public Styles for Appointment Booking System
 */

/* Reset and Base Styles */
.abs-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
}

.abs-container * {
    box-sizing: border-box;
}

/* Calendar Styles */
.abs-calendar {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.abs-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.abs-calendar-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.abs-calendar-nav {
    display: flex;
    gap: 10px;
}

.abs-calendar-nav button {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.abs-calendar-nav button:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.abs-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #dee2e6;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}

.abs-calendar-day-header {
    background: #6c757d;
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.abs-calendar-day {
    background: white;
    padding: 15px 10px;
    min-height: 80px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.abs-calendar-day:hover {
    background: #f8f9fa;
}

.abs-calendar-day.other-month {
    background: #f8f9fa;
    color: #6c757d;
}

.abs-calendar-day.today {
    background: #e3f2fd;
    border: 2px solid #2196f3;
}

.abs-calendar-day.has-appointments {
    background: #fff3cd;
}

.abs-calendar-day-number {
    font-weight: 600;
    margin-bottom: 5px;
}

.abs-appointment-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Form Styles */
.abs-form {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.abs-form-group {
    margin-bottom: 20px;
}

.abs-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.abs-form-label.required::after {
    content: " *";
    color: #dc3545;
}

.abs-form-input,
.abs-form-select,
.abs-form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.abs-form-input:focus,
.abs-form-select:focus,
.abs-form-textarea:focus {
    outline: 0;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.abs-form-textarea {
    resize: vertical;
    min-height: 100px;
}

.abs-form-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

.abs-form-help {
    color: #6c757d;
    font-size: 14px;
    margin-top: 5px;
}

/* Button Styles */
.abs-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.abs-btn-primary {
    background: #007cba;
    color: white;
}

.abs-btn-primary:hover {
    background: #005a87;
    color: white;
}

.abs-btn-secondary {
    background: #6c757d;
    color: white;
}

.abs-btn-secondary:hover {
    background: #545b62;
    color: white;
}

.abs-btn-success {
    background: #28a745;
    color: white;
}

.abs-btn-success:hover {
    background: #1e7e34;
    color: white;
}

.abs-btn-danger {
    background: #dc3545;
    color: white;
}

.abs-btn-danger:hover {
    background: #c82333;
    color: white;
}

.abs-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading Spinner */
.abs-loading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #6c757d;
}

.abs-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: abs-spin 1s linear infinite;
}

@keyframes abs-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alert Messages */
.abs-alert {
    padding: 15px 20px;
    margin: 20px 0;
    border: 1px solid transparent;
    border-radius: 4px;
    position: relative;
}

.abs-alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.abs-alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.abs-alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.abs-alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.abs-alert-dismissible {
    padding-right: 50px;
}

.abs-alert-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
}

.abs-alert-close:hover {
    opacity: 1;
}

/* Time Slots */
.abs-time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.abs-time-slot {
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.abs-time-slot:hover {
    border-color: #007cba;
    background: #f8f9fa;
}

.abs-time-slot.selected {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.abs-time-slot.unavailable {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .abs-calendar-grid {
        font-size: 14px;
    }
    
    .abs-calendar-day {
        min-height: 60px;
        padding: 10px 5px;
    }
    
    .abs-form {
        padding: 20px;
    }
    
    .abs-time-slots {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .abs-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* RTL Support - Enhanced */
body.rtl .abs-calendar-header,
body.abs-rtl .abs-calendar-header {
    direction: rtl;
}

body.rtl .abs-calendar-nav,
body.abs-rtl .abs-calendar-nav {
    direction: rtl;
}

body.rtl .abs-form-label.required::after,
body.abs-rtl .abs-form-label.required::after {
    content: "* ";
}

body.rtl .abs-alert-dismissible,
body.abs-rtl .abs-alert-dismissible {
    padding-right: 20px;
    padding-left: 50px;
}

body.rtl .abs-alert-close,
body.abs-rtl .abs-alert-close {
    right: auto;
    left: 20px;
}

/* Persian Calendar Specific - Enhanced */
.abs-calendar.persian .abs-calendar-day-header,
.abs-calendar.persian .abs-calendar-day-number,
body.abs-rtl .abs-calendar-day-header,
body.abs-rtl .abs-calendar-day-number {
    font-family: 'Vazir', 'Tahoma', sans-serif;
}

/* Enhanced RTL Support */
body.abs-rtl .abs-container,
body.abs-rtl .abs-calendar,
body.abs-rtl .abs-form {
    direction: rtl !important;
    text-align: right !important;
    font-family: 'Vazir', 'Tahoma', 'Arial', sans-serif !important;
}

body.abs-rtl .abs-form-input,
body.abs-rtl .abs-form-select,
body.abs-rtl .abs-form-textarea {
    direction: rtl !important;
    text-align: right !important;
}

body.abs-rtl .abs-calendar-nav {
    flex-direction: row-reverse;
}

body.abs-rtl .abs-time-slots {
    direction: rtl;
}

body.abs-rtl .abs-btn {
    direction: rtl;
}

/* Load Vazir font from CDN */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v30.1.0/dist/font-face.css');

/* Print Styles */
@media print {
    .abs-calendar-nav,
    .abs-btn,
    .abs-form {
        display: none !important;
    }
    
    .abs-calendar {
        box-shadow: none;
        border: 1px solid #000;
    }
}