/**
 * iHandi Portal - Appointments Module Styles
 * Based on ACTUAL PHP output from class-appointments-module.php
 * Version: 1.0.0
 */

/* ========================================
   APPOINTMENTS MODULE MAIN CONTAINER
   ======================================== */

.appointments-module {
    padding: 0;
    background: #f5f5f5;
}

/* ========================================
   APPOINTMENTS HEADER & STATS
   ======================================== */

.appointments-header {
    margin-bottom: 2rem;
}

.appointments-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.appointment-stat-badge {
    background: #ffffff;
    padding: 1.2rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid;
}

.appointment-stat-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Stat badge variants */
.appointment-stat-badge.stat-all {
    border-left-color: #2196F3;
}

.appointment-stat-badge.stat-all > i {
    color: #2196F3;
    font-size: 1.8rem;
}

.appointment-stat-badge.stat-pending {
    border-left-color: #FF9800;
}

.appointment-stat-badge.stat-pending > i {
    color: #FF9800;
    font-size: 1.8rem;
}

.appointment-stat-badge.stat-confirmed {
    border-left-color: #00BCD4;
}

.appointment-stat-badge.stat-confirmed > i {
    color: #00BCD4;
    font-size: 1.8rem;
}

.appointment-stat-badge.stat-completed {
    border-left-color: #4CAF50;
}

.appointment-stat-badge.stat-completed > i {
    color: #4CAF50;
    font-size: 1.8rem;
}

.appointment-stat-badge.stat-cancelled {
    border-left-color: #F44336;
}

.appointment-stat-badge.stat-cancelled > i {
    color: #F44336;
    font-size: 1.8rem;
}

/* The unnamed div wrapper inside stat badge */
.appointment-stat-badge > div {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

/* ========================================
   APPOINTMENTS FILTERS
   ======================================== */

.appointments-filters {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.filter-group input,
.filter-group select {
    padding: 0.7rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.filter-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ========================================
   APPOINTMENTS TABLE
   ======================================== */

.appointments-table-wrapper {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.appointments-table {
    width: 100%;
    border-collapse: collapse;
}

.appointments-table thead {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.appointments-table thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #1a1a1a;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.appointments-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.appointments-table tbody tr:hover {
    background: #f9f9f9;
}

.appointments-table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* Checkboxes */
.appointment-checkbox,
#select-all-appointments {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #FFD700;
}

/* Date/Time Column */
.appointment-datetime {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.appointment-date,
.appointment-time {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.appointment-date {
    color: #1a1a1a;
    font-weight: 600;
}

.appointment-date i {
    color: #FFD700;
    font-size: 0.85rem;
}

.appointment-time {
    color: #666;
}

.appointment-time i {
    color: #999;
    font-size: 0.85rem;
}

/* Customer Info */
.customer-info {
    display: flex;
    flex-direction: column;
}

.customer-name {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 0.95rem;
}

/* Contact Info */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: #666;
}

.contact-info div {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.contact-info i {
    font-size: 0.8rem;
    color: #999;
    width: 14px;
}

/* Location Badge */
.location-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid #FFD700;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #d4a000;
}

.location-badge i {
    font-size: 0.8rem;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.status-pending {
    background: rgba(255, 152, 0, 0.1);
    color: #FF9800;
    border: 1px solid #FF9800;
}

.status-badge.status-confirmed {
    background: rgba(0, 188, 212, 0.1);
    color: #00BCD4;
    border: 1px solid #00BCD4;
}

.status-badge.status-completed {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.status-badge.status-cancelled {
    background: rgba(244, 67, 54, 0.1);
    color: #F44336;
    border: 1px solid #F44336;
}

/* ========================================
   APPOINTMENT ACTIONS
   ======================================== */

.appointment-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: none;
    background: #f5f5f5;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: #FFD700;
    color: #1a1a1a;
    transform: translateY(-2px);
}

/* Action Dropdown */
.action-dropdown {
    position: relative;
}

.action-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    min-width: 180px;
    display: none;
    z-index: 100;
    margin-top: 0.5rem;
}

.action-dropdown:hover .action-dropdown-menu {
    display: block;
}

.action-dropdown-menu button {
    width: 100%;
    padding: 0.7rem 1rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: #1a1a1a;
}

.action-dropdown-menu button:hover {
    background: #f5f5f5;
}

.action-dropdown-menu button i {
    width: 18px;
    font-size: 0.9rem;
}

/* ========================================
   BULK ACTIONS BAR
   ======================================== */

.bulk-actions-bar {
    background: #f5f5f5;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.selected-count {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 0.95rem;
}

.bulk-actions-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

/* ========================================
   EMPTY STATE
   ======================================== */

.appointments-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #999;
}

.appointments-empty i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.appointments-empty p {
    font-size: 1.1rem;
    margin: 0.5rem 0 0 0;
}

/* ========================================
   PORTAL BUTTONS (used in filters)
   ======================================== */

.portal-btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.portal-btn-primary {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a1a;
}

.portal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.portal-btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.portal-btn-secondary:hover {
    background: #e0e0e0;
    color: #333;
}

.portal-btn-success {
    background: #4CAF50;
    color: #ffffff;
}

.portal-btn-success:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.portal-btn-danger {
    background: #F44336;
    color: #ffffff;
}

.portal-btn-danger:hover {
    background: #e53935;
}

.portal-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1200px) {
    .appointments-stats-row {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }
    
    .appointments-table {
        font-size: 0.85rem;
    }
}

@media (max-width: 968px) {
    .filter-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .filter-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .appointments-stats-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    /* Make table scrollable on mobile */
    .appointments-table-wrapper {
        overflow-x: auto;
    }
    
    .appointments-table {
        min-width: 900px;
    }
    
    .bulk-actions-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .appointments-stats-row {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .filter-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .filter-actions .portal-btn {
        width: 100%;
        justify-content: center;
    }
}