/* ========================================
   BARBER BOOKING PRO - ADMIN STYLES
   Modern & Professional Admin Interface
   ======================================== */

/* ========== VARIABLES ========== */
:root {
    --bbp-admin-primary: #1a1a2e;
    --bbp-admin-accent: #0f3460;
    --bbp-admin-bg: #f9fafb;
    --bbp-admin-border: #e5e7eb;
    --bbp-admin-text: #1f2937;
    --bbp-admin-text-light: #6b7280;
}

/* ========== MAIN WRAPPER ========== */
.bbp {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ========== CARDS ========== */
.bbp .bbp-card {
    background: #ffffff;
    border: 1px solid var(--bbp-admin-border);
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.bbp .bbp-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.bbp .bbp-card h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
    color: var(--bbp-admin-text);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bbp-admin-bg);
}

/* ========== GRID LAYOUT ========== */
.bbp .bbp-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}

@media (max-width: 782px) {
    .bbp .bbp-grid {
        grid-template-columns: 1fr;
    }
}

.bbp .bbp-grid label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 500;
    color: var(--bbp-admin-text);
    font-size: 14px;
}

.bbp .bbp-grid input[type="text"],
.bbp .bbp-grid input[type="email"],
.bbp .bbp-grid input[type="number"],
.bbp .bbp-grid input[type="date"],
.bbp .bbp-grid input[type="time"],
.bbp .bbp-grid input[type="datetime-local"],
.bbp .bbp-grid select,
.bbp .bbp-grid textarea {
    padding: 10px 14px;
    border: 1px solid var(--bbp-admin-border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #ffffff;
}

.bbp .bbp-grid input:focus,
.bbp .bbp-grid select:focus,
.bbp .bbp-grid textarea:focus {
    outline: none;
    border-color: var(--bbp-admin-primary);
    box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.1);
}

.bbp .bbp-grid input:hover,
.bbp .bbp-grid select:hover,
.bbp .bbp-grid textarea:hover {
    border-color: var(--bbp-admin-text-light);
}

/* ========== ROW LAYOUT ========== */
.bbp .bbp-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 12px 0 20px;
    flex-wrap: wrap;
}

.bbp .bbp-row input[type="date"] {
    padding: 8px 12px;
    border: 1px solid var(--bbp-admin-border);
    border-radius: 8px;
    font-size: 14px;
}

/* ========== SPAN UTILITIES ========== */
.bbp .bbp-span2 {
    grid-column: 1 / span 2;
}

@media (max-width: 782px) {
    .bbp .bbp-span2 {
        grid-column: 1;
    }
}

/* ========== TABLES ========== */
.bbp table.widefat {
    border: 1px solid var(--bbp-admin-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.bbp table.widefat thead {
    background: linear-gradient(135deg, var(--bbp-admin-primary) 0%, var(--bbp-admin-accent) 100%);
}

.bbp table.widefat thead th {
    color: #ffffff;
    font-weight: 600;
    padding: 14px 12px;
    border-bottom: none;
}

.bbp table.widefat tbody tr {
    transition: background-color 0.15s ease;
}

.bbp table.widefat tbody tr:hover {
    background-color: var(--bbp-admin-bg);
}

.bbp table.widefat td {
    padding: 12px;
    border-bottom: 1px solid var(--bbp-admin-border);
}

/* ========== BUTTONS ========== */
.bbp .button-primary {
    background: linear-gradient(135deg, var(--bbp-admin-primary) 0%, var(--bbp-admin-accent) 100%);
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    text-shadow: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
}

.bbp .button-primary:hover {
    background: linear-gradient(135deg, var(--bbp-admin-accent) 0%, var(--bbp-admin-primary) 100%);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.bbp .button-secondary {
    border: 1px solid var(--bbp-admin-border);
    background: #ffffff;
    color: var(--bbp-admin-text);
    border-radius: 8px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.bbp .button-secondary:hover {
    background: var(--bbp-admin-bg);
    border-color: var(--bbp-admin-text-light);
}

/* ========== DESCRIPTIONS ========== */
.bbp .description {
    color: var(--bbp-admin-text-light);
    font-size: 13px;
    font-style: italic;
    margin-top: 12px;
    padding: 12px;
    background: var(--bbp-admin-bg);
    border-left: 3px solid var(--bbp-admin-primary);
    border-radius: 4px;
}

/* ========== CHECKBOXES ========== */
.bbp input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--bbp-admin-primary);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 782px) {
    .bbp .bbp-card {
        padding: 16px;
        margin: 12px 0;
    }

    .bbp table.widefat {
        font-size: 13px;
    }

    .bbp table.widefat th,
    .bbp table.widefat td {
        padding: 10px 8px;
    }
}

/* ========== NOTICES ========== */
.bbp .notice {
    border-left-width: 4px;
    border-radius: 4px;
    padding: 12px;
    margin: 16px 0;
}

.bbp .notice-success {
    border-left-color: #10b981;
    background: #d1fae5;
}

.bbp .notice-error {
    border-left-color: #ef4444;
    background: #fee2e2;
}

.bbp .notice-warning {
    border-left-color: #f59e0b;
    background: #fef3c7;
}

.bbp .notice-info {
    border-left-color: #3b82f6;
    background: #dbeafe;
}

/* ========== CALENDAR VIEWS ========== */

/* Calendar Controls */
.bbp-calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--bbp-admin-border);
    border-radius: 12px;
    flex-wrap: wrap;
}

.bbp-view-selector {
    display: flex;
    gap: 8px;
    background: var(--bbp-admin-bg);
    padding: 4px;
    border-radius: 8px;
}

.bbp-view-btn {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--bbp-admin-text);
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.bbp-view-btn:hover {
    background: #ffffff;
    border-color: var(--bbp-admin-border);
}

.bbp-view-btn.active {
    background: linear-gradient(135deg, var(--bbp-admin-primary) 0%, var(--bbp-admin-accent) 100%);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bbp-date-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.bbp-date-picker {
    padding: 8px 12px;
    border: 1px solid var(--bbp-admin-border);
    border-radius: 8px;
    font-size: 14px;
}

/* Day View */
.bbp-calendar-day {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.bbp-staff-column {
    background: var(--bbp-admin-bg);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--bbp-admin-border);
}

.bbp-staff-header {
    background: linear-gradient(135deg, var(--bbp-admin-primary) 0%, var(--bbp-admin-accent) 100%);
    color: #ffffff;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 16px;
}

.bbp-timeline {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
}

.bbp-appointment {
    background: #ffffff;
    border-left: 4px solid #3b82f6;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    position: relative;
}

.bbp-appointment:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.bbp-apt-time {
    font-weight: 700;
    color: var(--bbp-admin-primary);
    font-size: 14px;
    margin-bottom: 6px;
}

.bbp-apt-service {
    font-weight: 600;
    color: var(--bbp-admin-text);
    margin-bottom: 4px;
}

.bbp-apt-customer {
    color: var(--bbp-admin-text-light);
    font-size: 13px;
    margin-bottom: 4px;
}

.bbp-apt-phone {
    color: var(--bbp-admin-text-light);
    font-size: 12px;
    margin-bottom: 6px;
}

.bbp-apt-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.bbp-status-confirmed {
    background: #d1fae5;
    color: #065f46;
}

.bbp-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.bbp-status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.bbp-apt-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    text-decoration: none;
    font-size: 16px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.bbp-apt-delete:hover {
    opacity: 1;
}

/* Week View */
.bbp-calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.bbp-week-day {
    background: var(--bbp-admin-bg);
    border: 1px solid var(--bbp-admin-border);
    border-radius: 8px;
    overflow: hidden;
    min-height: 300px;
}

.bbp-week-day.today {
    border-color: var(--bbp-admin-primary);
    border-width: 2px;
}

.bbp-week-day-header {
    background: linear-gradient(135deg, var(--bbp-admin-primary) 0%, var(--bbp-admin-accent) 100%);
    color: #ffffff;
    padding: 10px;
    font-weight: 600;
    text-align: center;
}

.bbp-week-day.today .bbp-week-day-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.bbp-week-day-appointments {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bbp-week-appointment {
    background: #ffffff;
    border-left: 3px solid #3b82f6;
    border-radius: 4px;
    padding: 8px;
    font-size: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.bbp-week-appointment:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bbp-week-apt-time {
    font-weight: 700;
    color: var(--bbp-admin-primary);
    margin-bottom: 4px;
}

.bbp-week-apt-staff {
    font-weight: 600;
    font-size: 11px;
    color: var(--bbp-admin-text);
}

.bbp-week-apt-service {
    color: var(--bbp-admin-text-light);
    font-size: 11px;
}

/* Worker View */
.bbp-worker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.bbp-worker-card {
    background: var(--bbp-admin-bg);
    border: 1px solid var(--bbp-admin-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.bbp-worker-header {
    background: linear-gradient(135deg, var(--bbp-admin-primary) 0%, var(--bbp-admin-accent) 100%);
    color: #ffffff;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bbp-worker-header h3 {
    margin: 0;
    font-size: 18px;
}

.bbp-worker-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.bbp-worker-appointments {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bbp-worker-appointment {
    background: #ffffff;
    border-left: 4px solid #3b82f6;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.bbp-worker-appointment:hover {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

.bbp-worker-apt-time {
    font-weight: 700;
    color: var(--bbp-admin-primary);
    margin-bottom: 6px;
}

.bbp-worker-apt-service {
    font-weight: 600;
    color: var(--bbp-admin-text);
    margin-bottom: 4px;
}

.bbp-worker-apt-customer {
    color: var(--bbp-admin-text-light);
    font-size: 13px;
    margin-bottom: 4px;
}

.bbp-worker-apt-phone {
    color: var(--bbp-admin-text-light);
    font-size: 12px;
}

.bbp-no-appointments {
    color: var(--bbp-admin-text-light);
    font-style: italic;
    text-align: center;
    padding: 40px 20px;
}

/* Responsive Calendar & Controls */
@media (max-width: 1200px) {
    .bbp-calendar-week {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Frontend Admin Specific Fixes */
.bbp-frontend-admin .bbp-view-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.bbp-frontend-admin .bbp-view-btn {
    flex: 1;
    min-width: 120px;
    text-align: center;
    background: #fff;
    border: 1px solid var(--bbp-admin-border);
    border-radius: 8px;
    /* More rounded */
    padding: 10px 15px;
    /* Bigger touch target */
    font-size: 14px;
}

.bbp-frontend-admin .bbp-view-btn.active {
    background: var(--bbp-admin-primary);
    border-color: var(--bbp-admin-primary);
    color: #fff;
}

.bbp-frontend-admin .button,
.bbp-frontend-admin .bbp-date-nav .button {
    background: #fff;
    border: 1px solid var(--bbp-admin-border);
    color: var(--bbp-admin-text);
    padding: 0 16px;
    /* Horizontal padding only, height set by height property */
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    /* Consistent height */
    box-sizing: border-box;
    transition: all 0.2s ease;
    white-space: nowrap;
    /* Prevent text wrapping */
    flex-shrink: 0;
    /* Prevent button from squashing */
}

.bbp-frontend-admin .button:hover {
    background: var(--bbp-admin-bg);
    border-color: var(--bbp-admin-text-light);
    transform: translateY(-1px);
}

.bbp-frontend-admin .bbp-date-picker {
    height: 40px;
    /* Match buttons */
    box-sizing: border-box;
}

@media (max-width: 782px) {
    .bbp .bbp-calendar-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 15px;
    }

    .bbp-view-selector {
        justify-content: stretch;
    }

    .bbp-view-btn {
        flex: 1;
        font-size: 13px;
        padding: 8px;
        white-space: nowrap;
    }

    /* Mobile Date Nav: Date on top, buttons below */
    .bbp-frontend-admin .bbp-date-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .bbp-frontend-admin .bbp-date-nav input[type="date"] {
        order: -1;
        /* Date on top */
        width: 100%;
        text-align: center;
        margin-bottom: 4px;
    }

    .bbp-frontend-admin .bbp-date-nav .button {
        flex: 1;
        padding: 0 8px;
        /* Slightly less padding on mobile */
        font-size: 13px;
    }

    .bbp-calendar-day {
        grid-template-columns: 1fr;
    }

    .bbp-calendar-week {
        grid-template-columns: 1fr;
    }

    .bbp-worker-grid {
        grid-template-columns: 1fr;
    }

    /* Stack tables card data for mobile list view */
    .bbp table.widefat,
    .bbp table.widefat tbody,
    .bbp table.widefat tr,
    .bbp table.widefat td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .bbp table.widefat thead {
        display: none;
        /* Hide header on mobile */
    }

    .bbp table.widefat tr {
        margin-bottom: 15px;
        border: 1px solid var(--bbp-admin-border);
        border-radius: 8px;
        padding: 10px;
        background: #fff;
    }

    .bbp table.widefat td {
        text-align: right;
        padding: 8px 4px;
        border-bottom: 1px solid #eee;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .bbp table.widefat td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        color: var(--bbp-admin-text-light);
    }

    .bbp table.widefat td:last-child {
        border-bottom: none;
        justify-content: flex-end;
    }
}