/**
 * TipTree Booking - Agent Dashboard Styles
 * Version 1.2.0
 */

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
    --ttbk-gold: #FBB03B;
    --ttbk-gold-dark: #E09A2F;
    --ttbk-gold-light: #FFC966;
    --ttbk-dark: #1a1a2e;
    --ttbk-white: #ffffff;
    --ttbk-gray-50: #fafafa;
    --ttbk-gray-100: #f5f5f5;
    --ttbk-gray-200: #eeeeee;
    --ttbk-gray-300: #e0e0e0;
    --ttbk-gray-400: #bdbdbd;
    --ttbk-gray-500: #9e9e9e;
    --ttbk-gray-600: #757575;
    --ttbk-gray-700: #616161;
    --ttbk-gray-800: #424242;
    --ttbk-gray-900: #212121;
    --ttbk-green: #28a745;
    --ttbk-green-light: #d4edda;
    --ttbk-red: #dc3545;
    --ttbk-red-light: #f8d7da;
    --ttbk-blue: #007bff;
    --ttbk-blue-light: #cce5ff;
    --ttbk-yellow: #ffc107;
    --ttbk-yellow-light: #fff3cd;
    --ttbk-radius: 8px;
    --ttbk-radius-lg: 12px;
    --ttbk-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --ttbk-shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
}

/* ==========================================================================
   Base Dashboard
   ========================================================================== */
.ttbk-agent-dashboard {
    background: var(--ttbk-gray-100);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ttbk-agent-dashboard *,
.ttbk-agent-dashboard *::before,
.ttbk-agent-dashboard *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Modal Styles (with !important to override themes)
   ========================================================================== */
.ttbk-modal {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 999999 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    overflow: auto !important;
}

.ttbk-modal.active {
    display: flex !important;
}

.ttbk-modal-content {
    background: #ffffff !important;
    border-radius: 12px !important;
    padding: 24px !important;
    max-width: 500px !important;
    width: 100% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    position: relative !important;
    margin: auto !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
}

.ttbk-create-event-modal-content {
    max-width: 560px !important;
}

.ttbk-event-details-modal-content {
    max-width: 500px !important;
}

.ttbk-modal-close {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    background: none !important;
    border: none !important;
    font-size: 28px !important;
    color: #6c757d !important;
    cursor: pointer !important;
    line-height: 1 !important;
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: background 0.2s, color 0.2s !important;
}

.ttbk-modal-close:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    color: #333 !important;
}

.ttbk-modal h3 {
    font-size: 22px !important;
    font-weight: 600 !important;
    margin: 0 0 8px !important;
    color: #212529 !important;
    padding-right: 40px !important;
}

.ttbk-modal-subtitle {
    font-size: 14px !important;
    color: #6c757d !important;
    margin: 0 0 24px !important;
}

.ttbk-modal-actions {
    display: flex !important;
    gap: 12px !important;
    margin-top: 24px !important;
    justify-content: flex-end !important;
    padding-top: 16px !important;
    border-top: 1px solid #e9ecef !important;
}

/* ==========================================================================
   Form Styles
   ========================================================================== */
.ttbk-form-group {
    margin-bottom: 16px;
}

.ttbk-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.ttbk-form-group label .required {
    color: var(--ttbk-red);
}

.ttbk-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.ttbk-form-half {
    flex: 1;
    margin-bottom: 0;
}

.ttbk-form-group input[type="text"],
.ttbk-form-group input[type="email"],
.ttbk-form-group input[type="number"],
.ttbk-form-group input[type="date"],
.ttbk-form-group input[type="time"],
.ttbk-form-group select,
.ttbk-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ttbk-form-group input:focus,
.ttbk-form-group select:focus,
.ttbk-form-group textarea:focus {
    outline: none;
    border-color: var(--ttbk-gold);
    box-shadow: 0 0 0 3px rgba(251, 176, 59, 0.2);
}

.ttbk-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.ttbk-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400 !important;
    padding-top: 8px;
}

.ttbk-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ==========================================================================
   Button Styles
   ========================================================================== */
.ttbk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
}

.ttbk-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ttbk-btn-primary {
    background: var(--ttbk-gold);
    color: #fff;
    border: 1px solid var(--ttbk-gold);
}

.ttbk-btn-primary:hover:not(:disabled) {
    background: var(--ttbk-gold-dark);
    border-color: var(--ttbk-gold-dark);
}

.ttbk-btn-outline {
    background: transparent;
    color: #6c757d;
    border: 1px solid #ced4da;
}

.ttbk-btn-outline:hover:not(:disabled) {
    background: #f8f9fa;
    color: #333;
}

.ttbk-btn-danger {
    background: var(--ttbk-red);
    color: #fff;
    border: 1px solid var(--ttbk-red);
}

.ttbk-btn-danger:hover:not(:disabled) {
    background: #c82333;
    border-color: #c82333;
}

.ttbk-btn-text {
    display: inline;
}

.ttbk-btn-loading {
    display: none;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.ttbk-toast-container {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    z-index: 9999999 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    pointer-events: none !important;
}

.ttbk-toast {
    padding: 14px 20px !important;
    border-radius: 8px !important;
    background: #333 !important;
    color: #fff !important;
    font-size: 14px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    opacity: 0 !important;
    transform: translateX(100%) !important;
    transition: all 0.3s ease !important;
    pointer-events: auto !important;
    max-width: 350px !important;
}

.ttbk-toast-visible {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

.ttbk-toast-out {
    opacity: 0 !important;
    transform: translateX(100%) !important;
}

.ttbk-toast-success {
    background: var(--ttbk-green) !important;
}

.ttbk-toast-error {
    background: var(--ttbk-red) !important;
}

.ttbk-toast-info {
    background: var(--ttbk-blue) !important;
}

/* ==========================================================================
   Event Details Modal
   ========================================================================== */
.ttbk-event-details {
    padding: 0;
}

.ttbk-event-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e9ecef;
}

.ttbk-event-header h3 {
    margin: 0 !important;
    padding-right: 0 !important;
}

.ttbk-event-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ttbk-info-row {
    display: flex;
    gap: 12px;
}

.ttbk-info-label {
    font-weight: 500;
    color: #6c757d;
    min-width: 100px;
}

.ttbk-info-value {
    color: #333;
}

.ttbk-info-full {
    flex-direction: column;
    gap: 4px;
}

.ttbk-info-full .ttbk-info-value {
    white-space: pre-wrap;
}

/* ==========================================================================
   Status Badges
   ========================================================================== */
.ttbk-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: capitalize;
}

.ttbk-status-open {
    background: var(--ttbk-green-light);
    color: var(--ttbk-green);
}

.ttbk-status-reviewing,
.ttbk-status-pending {
    background: var(--ttbk-yellow-light);
    color: #856404;
}

.ttbk-status-offered {
    background: var(--ttbk-blue-light);
    color: var(--ttbk-blue);
}

.ttbk-status-booked,
.ttbk-status-accepted,
.ttbk-status-confirmed {
    background: var(--ttbk-green-light);
    color: var(--ttbk-green);
}

.ttbk-status-completed {
    background: var(--ttbk-gray-200);
    color: var(--ttbk-gray-700);
}

.ttbk-status-cancelled,
.ttbk-status-declined {
    background: var(--ttbk-red-light);
    color: var(--ttbk-red);
}

/* ==========================================================================
   Calendar Styles
   ========================================================================== */
#ttbk-agent-calendar {
    background: #fff;
    border-radius: var(--ttbk-radius-lg);
    padding: 16px;
    box-shadow: var(--ttbk-shadow);
}

.ttbk-event-open {
    background: var(--ttbk-green) !important;
    border-color: var(--ttbk-green) !important;
}

.ttbk-event-reviewing,
.ttbk-event-pending {
    background: var(--ttbk-yellow) !important;
    border-color: var(--ttbk-yellow) !important;
    color: #333 !important;
}

.ttbk-event-booked,
.ttbk-event-confirmed {
    background: var(--ttbk-blue) !important;
    border-color: var(--ttbk-blue) !important;
}

.ttbk-event-completed {
    background: var(--ttbk-gray-500) !important;
    border-color: var(--ttbk-gray-500) !important;
}

.ttbk-event-cancelled {
    background: var(--ttbk-red) !important;
    border-color: var(--ttbk-red) !important;
}

/* ==========================================================================
   Loading State
   ========================================================================== */
.ttbk-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6c757d;
}

.ttbk-error {
    color: var(--ttbk-red);
    padding: 20px;
    text-align: center;
}

/* ==========================================================================
   Kanban Styles
   ========================================================================== */
.ttbk-kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.ttbk-kanban-column {
    flex: 0 0 280px;
    background: var(--ttbk-gray-100);
    border-radius: var(--ttbk-radius-lg);
    padding: 12px;
}

.ttbk-kanban-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    margin-bottom: 12px;
}

.ttbk-kanban-title {
    font-weight: 600;
    color: #333;
}

.ttbk-kanban-count {
    background: var(--ttbk-gray-300);
    color: var(--ttbk-gray-700);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.ttbk-kanban-cards {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ttbk-kanban-empty {
    text-align: center;
    color: var(--ttbk-gray-400);
    font-size: 13px;
    padding: 20px;
}

.ttbk-kanban-card {
    background: #fff;
    border-radius: var(--ttbk-radius);
    padding: 12px;
    box-shadow: var(--ttbk-shadow);
    cursor: grab;
    border-left: 3px solid var(--ttbk-gold);
}

.ttbk-kanban-card:hover {
    box-shadow: var(--ttbk-shadow-md);
}

.ttbk-kanban-card:active {
    cursor: grabbing;
}

.ttbk-kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.ttbk-kanban-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--ttbk-gold);
}

.ttbk-kanban-venue {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--ttbk-gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ttbk-kanban-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--ttbk-gray-500);
    margin-bottom: 6px;
}

.ttbk-kanban-rate {
    font-weight: 600;
    color: var(--ttbk-gray-700);
}

.ttbk-kanban-talent {
    font-size: 11px;
    color: var(--ttbk-gray-400);
    background: var(--ttbk-gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
}

.ttbk-kanban-apps {
    font-size: 12px;
    color: var(--ttbk-gray-500);
    margin-bottom: 8px;
}

.ttbk-kanban-actions {
    display: flex;
    justify-content: flex-end;
}

.ttbk-btn-xs {
    padding: 4px 8px;
    font-size: 11px;
}

.ttbk-kanban-ghost {
    opacity: 0.4;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .ttbk-modal-content {
        margin: 16px !important;
        padding: 20px !important;
        max-height: calc(100vh - 32px) !important;
    }

    .ttbk-form-row {
        flex-direction: column;
        gap: 0;
    }

    .ttbk-form-half {
        margin-bottom: 16px;
    }

    .ttbk-modal-actions {
        flex-direction: column-reverse;
    }

    .ttbk-modal-actions .ttbk-btn {
        width: 100%;
    }

    .ttbk-toast-container {
        left: 16px !important;
        right: 16px !important;
        bottom: 16px !important;
    }

    .ttbk-toast {
        max-width: 100% !important;
    }

    .ttbk-kanban-board {
        flex-direction: column;
    }

    .ttbk-kanban-column {
        flex: none;
        width: 100%;
    }
}
