/**
 * Frontend Styles for eAgents Easy Reservations
 *
 * @package EAgents_Easy_Reservations
 * @since 1.0.0
 */

/* ========================================
   GENERAL STYLES
   ======================================== */

.eagents-calendar-container,
.eagents-registration-container,
.eagents-items-container,
.eagents-dashboard-container,
.eagents-availability-container {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.form-control.readonly {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.required {
    color: #d63638;
}

.form-text {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 44px;
    box-sizing: border-box;
}

.btn-primary {
    background-color: #0073aa;
    color: white;
}

.btn-primary:hover {
    background-color: #005a87;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #d63638;
    color: white;
}

.btn-danger:hover {
    background-color: #b32d2e;
}

/* Checkbox Styles */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ========================================
   CALENDAR STYLES
   ======================================== */

.eagents-calendar {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calendar-controls {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.item-selector,
.view-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calendar-item-select {
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.view-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.view-btn:hover,
.view-btn.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.calendar-loading {
    padding: 60px 20px;
    text-align: center;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #ddd;
}

.calendar-header {
    background: #0073aa;
    color: white;
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.calendar-day {
    background: white;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
}

.calendar-day:hover {
    background: #f8f9fa;
}

.calendar-day.other-month {
    background: #f5f5f5;
    color: #999;
}

.calendar-day.today {
    background: #e3f2fd;
    border-color: #0073aa;
}

.calendar-day.available {
    background: #e8f5e8;
    cursor: pointer;
}

.calendar-day.booked {
    background: #ffebee;
    cursor: not-allowed;
}

.calendar-day.unavailable {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.day-number {
    font-weight: 600;
    margin-bottom: 5px;
}

.time-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.time-slot {
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 2px;
    background: #0073aa;
    color: white;
    cursor: pointer;
}

.time-slot.booked {
    background: #d63638;
    cursor: not-allowed;
}

.time-slot.unavailable {
    background: #999;
    cursor: not-allowed;
}

/* ========================================
   BOOKING MODAL STYLES
   ======================================== */

.booking-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.booking-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.booking-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.booking-modal-header h3 {
    margin: 0;
    color: #0073aa;
}

.booking-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.booking-modal-close:hover {
    background: #f0f0f0;
    color: #000;
}

.booking-modal-body {
    padding: 20px;
}

/* ========================================
   ITEMS GRID STYLES
   ======================================== */

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.item-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.item-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.item-header h3 {
    margin: 0 0 15px 0;
    color: #0073aa;
    font-size: 20px;
}

.item-description {
    margin-bottom: 15px;
    color: #666;
}

.item-details {
    margin-bottom: 20px;
}

.item-price,
.item-duration {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.price-label,
.duration-label {
    font-weight: 600;
    color: #333;
}

.price-amount {
    color: #0073aa;
    font-weight: 600;
}

.item-actions {
    text-align: center;
}

.btn-book-item {
    width: 100%;
}

/* ========================================
   DASHBOARD STYLES
   ======================================== */

.dashboard-nav {
    margin-bottom: 30px;
}

.nav-tabs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    border-bottom: 2px solid #ddd;
    flex-wrap: wrap;
}

.nav-tabs li {
    margin-right: 5px;
}

.nav-tab {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #666;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
}

.nav-tab:hover,
.nav-tab.active {
    color: #0073aa;
    background: white;
    border-color: #ddd;
    border-bottom: 2px solid white;
    margin-bottom: -2px;
}

.tab-content {
    display: none;
    padding: 20px 0;
}

.tab-content.active {
    display: block;
}

.reservations-list {
    display: grid;
    gap: 20px;
}

.reservation-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.reservation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.reservation-header h4 {
    margin: 0;
    color: #0073aa;
}

.reservation-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-confirmed {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-cancelled {
    background: #ffebee;
    color: #d32f2f;
}

.status-pending {
    background: #fff3e0;
    color: #f57c00;
}

.reservation-details {
    margin-bottom: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-item .label {
    font-weight: 600;
    color: #333;
}

.detail-item .value {
    color: #666;
}

.reservation-actions {
    text-align: right;
}

.no-reservations {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
}

/* ========================================
   LANGUAGE SWITCHER STYLES
   ======================================== */

.eagents-language-switcher {
    margin: 10px 0;
}

.eagents-language-switcher select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.language-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.language-item a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    text-decoration: none;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.language-item a:hover,
.language-item.active a {
    color: #0073aa;
    border-color: #0073aa;
    background: #f0f8ff;
}

/* ========================================
   AVAILABILITY DISPLAY STYLES
   ======================================== */

.availability-list {
    display: grid;
    gap: 20px;
}

.availability-day {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.availability-day h5 {
    margin: 0 0 15px 0;
    color: #0073aa;
    font-size: 16px;
}

.time-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.time-slot {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

.time-slot.available {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.no-availability {
    color: #666;
    font-style: italic;
}

/* ========================================
   ALERT AND MESSAGE STYLES
   ======================================== */

.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background: #e8f5e8;
    color: #2e7d32;
    border-color: #4caf50;
}

.alert-error {
    background: #ffebee;
    color: #d32f2f;
    border-color: #f44336;
}

.alert-warning {
    background: #fff3e0;
    color: #f57c00;
    border-color: #ff9800;
}

.alert-info {
    background: #e3f2fd;
    color: #1976d2;
    border-color: #2196f3;
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for better accessibility */
.btn:focus,
.form-control:focus,
.nav-tab:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid #000;
    }
    
    .calendar-day {
        border: 2px solid #000;
    }
    
    .item-card {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/* ========================================
   ITEM CARDS WITH IMAGES
   ======================================== */

/* Item Cards with Images */
.eagents-available-items {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.eagents-available-items.columns-1 {
    grid-template-columns: 1fr;
}

.eagents-available-items.columns-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.eagents-available-items.columns-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.eagents-available-items.columns-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.eagents-item-card {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.eagents-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.item-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
}

.eagents-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.eagents-item-card:hover .eagents-item-image {
    transform: scale(1.05);
}

.item-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.placeholder-content {
    text-align: center;
}

.placeholder-content .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.placeholder-content p {
    margin: 0;
    font-size: 14px;
    opacity: 0.7;
}

.item-content {
    padding: 20px;
}

.item-content h4 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
}

.item-description {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.item-details {
    margin-bottom: 20px;
}

.item-details p {
    margin: 8px 0;
    font-size: 14px;
    color: #495057;
}

.item-details strong {
    color: #2c3e50;
}

.eagents-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.eagents-btn:hover {
    background: #005a87;
    color: #fff;
    text-decoration: none;
}

.eagents-btn-primary {
    background: #0073aa;
}

.eagents-btn-primary:hover {
    background: #005a87;
}

.eagents-btn-secondary {
    background: #6c757d;
}

.eagents-btn-secondary:hover {
    background: #545b62;
}

.eagents-btn-danger {
    background: #dc3545;
}

.eagents-btn-danger:hover {
    background: #c82333;
}

.eagents-btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

/* Form Styles for Shortcodes */
.eagents-form-group {
    margin-bottom: 20px;
}

.eagents-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.eagents-form-group input,
.eagents-form-group select,
.eagents-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.eagents-form-group input:focus,
.eagents-form-group select:focus,
.eagents-form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Notice Styles */
.eagents-notice {
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 4px;
    border-left: 4px solid;
}

.eagents-notice-success {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.eagents-notice-error {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.eagents-notice-info {
    background: #d1ecf1;
    border-left-color: #17a2b8;
    color: #0c5460;
}

/* Loading Spinner */
.eagents-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#eagents-loading {
    text-align: center;
    padding: 40px 20px;
}

/* Responsive Design for Item Cards */
@media (max-width: 768px) {
    .eagents-available-items {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    
    .item-content {
        padding: 16px;
    }
    
    .item-image,
    .item-image-placeholder {
        height: 180px;
    }
    
    .eagents-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .item-image,
    .item-image-placeholder {
        height: 160px;
    }
    
    .item-content h4 {
        font-size: 16px;
    }
    
    .item-description,
    .item-details p {
        font-size: 13px;
    }
}

/* ========================================
   AVAILABLE DATES ONLY CALENDAR STYLES
   ======================================== */

/* Available Dates Grid - Only shows bookable dates */
.eer-available-dates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
}

.eer-available-date {
    background: #d5f4e6;
    border: 2px solid #27ae60;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.eer-available-date:hover {
    background: #c3e9d0;
    border-color: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.eer-available-date.eer-selected {
    background: #3498db;
    border-color: #2980b9;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.eer-date-day {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.eer-date-weekday {
    font-size: 12px;
    text-transform: uppercase;
    opacity: 0.8;
}

.eer-select-item-message {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px;
}

.eer-no-dates {
    text-align: center;
    padding: 40px 20px;
    color: #e74c3c;
    font-size: 16px;
    background: #fadbd8;
    border-radius: 8px;
    margin: 20px;
}

.eer-error {
    text-align: center;
    padding: 20px;
    color: #e74c3c;
    background: #fadbd8;
    border-radius: 8px;
    margin: 20px;
}

.eer-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* Mobile Responsive for Available Dates */
@media (max-width: 768px) {
    .eer-available-dates-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
        padding: 15px;
    }
    
    .eer-available-date {
        padding: 12px;
    }
    
    .eer-date-day {
        font-size: 20px;
    }
    
    .eer-date-weekday {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .eer-available-dates-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
        padding: 10px;
    }
    
    .eer-available-date {
        padding: 10px;
    }
    
    .eer-date-day {
        font-size: 18px;
    }
}