/**
 * Public Dashboard Styles for Confirmación de Reservación de Citas
 * 
 * @package Confirmacion_Reservacion_Citas
 * @since 1.0.0
 */

/* Reset and Base */
.crc-dashboard-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Header */
.crc-dashboard-header {
    margin-bottom: 30px;
}

.crc-dashboard-header h2 {
    margin: 0 0 5px 0;
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
}

.crc-welcome {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Stats Grid */
.crc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.crc-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.crc-stat-number {
    display: block;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
}

.crc-stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

.crc-stat-upcoming .crc-stat-number { color: #3b82f6; }
.crc-stat-pending .crc-stat-number { color: #f59e0b; }
.crc-stat-paid .crc-stat-number { color: #10b981; }
.crc-stat-exempt .crc-stat-number { color: #8b5cf6; }

/* Filter Tabs */
.crc-filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

.crc-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.crc-tab:hover {
    background: #f3f4f6;
    color: #1a1a1a;
}

.crc-tab.active {
    background: #3b82f6;
    color: #fff;
}

/* Appointments List */
.crc-appointments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.crc-no-appointments {
    text-align: center;
    padding: 60px 20px;
    background: #f9fafb;
    border-radius: 12px;
    color: #666;
}

/* Appointment Card */
.crc-appointment-card {
    display: grid;
    grid-template-columns: 80px 1fr auto auto;
    gap: 20px;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #e5e7eb;
    transition: all 0.2s;
}

.crc-appointment-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.crc-appointment-card.crc-status-pending {
    border-left-color: #f59e0b;
}

.crc-appointment-card.crc-status-paid {
    border-left-color: #10b981;
}

.crc-appointment-card.crc-status-exempt {
    border-left-color: #8b5cf6;
}

/* Date Badge */
.crc-date-badge {
    text-align: center;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 12px 8px;
}

.crc-date-badge.crc-today {
    background: #fef3c7;
}

.crc-date-badge.crc-tomorrow {
    background: #dbeafe;
}

.crc-date-day {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
}

.crc-date-month {
    display: block;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    margin-top: 2px;
}

.crc-date-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    background: #f59e0b;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 5px;
}

.crc-today .crc-date-tag {
    background: #dc2626;
}

.crc-tomorrow .crc-date-tag {
    background: #3b82f6;
}

/* NOW - In Progress */
.crc-date-badge.crc-now {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    animation: pulse-now 2s ease-in-out infinite;
}

.crc-date-tag.crc-tag-now {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    animation: pulse-badge 1.5s ease-in-out infinite;
}

@keyframes pulse-now {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Just Finished */
.crc-date-badge.crc-finished {
    background: #f3f4f6;
}

.crc-date-tag.crc-tag-finished {
    background: #6b7280;
}

/* Card styles for in-progress and just-finished */
.crc-appointment-card.crc-in-progress {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

.crc-appointment-card.crc-just-finished {
    border-left-color: #9ca3af;
    opacity: 0.85;
}

/* Appointment Info */
.crc-appointment-info {
    min-width: 0;
}

.crc-customer-name {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.crc-first-visit-badge {
    display: inline-block;
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    color: #db2777;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid #fbcfe8;
}

.crc-appointment-time {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #666;
}

.crc-customer-contact {
    margin: 0;
    font-size: 13px;
}

.crc-customer-contact a {
    color: #3b82f6;
    text-decoration: none;
}

.crc-customer-contact a:hover {
    text-decoration: underline;
}

/* Payment Status */
.crc-payment-status {
    text-align: center;
}

.crc-status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

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

.crc-status-badge.crc-status-paid {
    background: #d1fae5;
    color: #065f46;
}

.crc-status-badge.crc-status-exempt {
    background: #ede9fe;
    color: #5b21b6;
}

.crc-payment-method,
.crc-reminder-count {
    display: block;
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

/* Action Buttons */
.crc-appointment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.crc-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.crc-btn-primary {
    background: #10b981;
    color: #fff;
}

.crc-btn-primary:hover {
    background: #059669;
}

.crc-btn-secondary {
    background: #8b5cf6;
    color: #fff;
}

.crc-btn-secondary:hover {
    background: #7c3aed;
}

.crc-btn-outline {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #374151;
}

.crc-btn-outline:hover {
    background: #f3f4f6;
}

.crc-btn-text {
    background: transparent;
    color: #6b7280;
    padding: 8px 10px;
}

.crc-btn-text:hover {
    color: #374151;
}

.crc-btn-link {
    background: transparent;
    color: #3b82f6;
}

.crc-btn-link:hover {
    text-decoration: underline;
}

/* Appointment Notes */
.crc-appointment-notes {
    grid-column: 1 / -1;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    font-size: 13px;
    color: #666;
}

/* Modal */
.crc-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.crc-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.crc-modal-content h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
}

.crc-form-group {
    margin-bottom: 15px;
}

.crc-form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.crc-form-group select,
.crc-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.crc-form-group textarea {
    resize: vertical;
}

.crc-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Login Required */
.crc-login-required,
.crc-no-permission {
    text-align: center;
    padding: 60px 20px;
    background: #f9fafb;
    border-radius: 12px;
}

.crc-login-button {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 24px;
    background: #3b82f6;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
}

.crc-login-button:hover {
    background: #2563eb;
}

/* Responsive */
@media (max-width: 768px) {
    .crc-appointment-card {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .crc-date-badge {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 15px;
    }
    
    .crc-date-day {
        font-size: 20px;
    }
    
    .crc-payment-status,
    .crc-appointment-actions {
        justify-content: flex-start;
    }
    
    .crc-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Copy Link Button - Prominent */
.crc-btn-copy {
    background: #10b981;
    color: white;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.crc-btn-copy:hover {
    background: #059669;
    transform: translateY(-1px);
}

.crc-btn-copy:active {
    transform: translateY(0);
}

.crc-btn-copy.copied {
    background: #6366f1;
}

/* Small Link Button */
.crc-btn-link-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background: #f3f4f6;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    color: #374151;
    transition: background 0.2s;
}

.crc-btn-link-small:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* Actions Layout - Organized in rows */
.crc-appointment-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
}

.crc-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.crc-actions-primary {
    /* Primary actions: Marcar Pagada, Marcar Exenta */
}

.crc-actions-secondary {
    /* Secondary actions: Recordatorio, Pausar */
}

.crc-actions-payment {
    /* Payment link actions */
    padding-top: 5px;
    border-top: 1px solid #e5e7eb;
    margin-top: 5px;
}

.crc-actions-danger {
    /* Danger zone: Cancel */
    padding-top: 5px;
    border-top: 1px solid #fecaca;
    margin-top: 5px;
}

/* Cancel/Danger Button */
.crc-btn-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.crc-btn-danger:hover {
    background: #fecaca;
    border-color: #f87171;
}

/* Modal Warning */
.crc-modal-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Checkbox Group */
.crc-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.crc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

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

.crc-help-text {
    margin: 5px 0 0 26px;
    font-size: 12px;
    color: #6b7280;
}

/* Toast Notification */
.crc-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    animation: toast-in 0.3s ease;
}

.crc-toast.success {
    background: #10b981;
}

.crc-toast.error {
    background: #ef4444;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Danger wrapper with vertical divider */
.crc-actions-danger-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 0;
}

.crc-vertical-divider {
    width: 1px;
    height: 24px;
    background: #fecaca;
}

/* Revert button row */
.crc-actions-revert {
    margin-top: 8px;
}

/* Outline small button */
.crc-btn-outline-small {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.crc-btn-outline-small:hover {
    background: #f3f4f6;
    color: #374151;
    border-color: #9ca3af;
}

/* =========================================================================
   TIME TABS (Upcoming / History)
   ========================================================================= */

.crc-time-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 10px;
    width: fit-content;
}

.crc-time-tab {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.crc-time-tab:hover {
    color: #374151;
}

.crc-time-tab.active {
    background: #fff;
    color: #1a1a1a;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.crc-time-content {
    display: block;
}

/* History Section */
.crc-history-header {
    margin-bottom: 15px;
}

.crc-history-description {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

/* History appointment card - slightly muted */
.crc-history-card {
    opacity: 0.9;
}

.crc-history-card .crc-date-badge {
    background: #f3f4f6;
}

.crc-history-card .crc-appointment-actions {
    display: none;
}

/* Status badge for history */
.crc-history-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.crc-history-status.status-completed {
    background: #d1fae5;
    color: #065f46;
}

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

.crc-history-status.status-no_show {
    background: #fef3c7;
    color: #92400e;
}

/* =========================================================================
   MAIN TABS (Appointments / Exempt Customers)
   ========================================================================= */

.crc-main-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 25px;
    border-bottom: 2px solid #e5e7eb;
}

.crc-main-tab {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.crc-main-tab:hover {
    color: #374151;
    background: #f9fafb;
}

.crc-main-tab.active {
    color: #8b5cf6;
    border-bottom-color: #8b5cf6;
    background: transparent;
}

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

/* =========================================================================
   EXEMPT CUSTOMERS TAB
   ========================================================================= */

.crc-exempt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.crc-exempt-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1a1a1a;
}

.crc-exempt-search {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.crc-exempt-search input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}

.crc-exempt-search input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Exempt Customers Table */
.crc-exempt-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.crc-exempt-table thead {
    background: #f9fafb;
}

.crc-exempt-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

.crc-exempt-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
}

.crc-exempt-table tr:last-child td {
    border-bottom: none;
}

.crc-exempt-table tr:hover {
    background: #faf5ff;
}

.crc-exempt-table a {
    color: #3b82f6;
    text-decoration: none;
}

.crc-exempt-table a:hover {
    text-decoration: underline;
}

.crc-exempt-reason {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #6b7280;
    font-size: 13px;
}

.crc-exempt-actions {
    white-space: nowrap;
}

/* Exempt Badge */
.crc-exempt-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.crc-exempt-badge.unlimited {
    background: #ede9fe;
    color: #5b21b6;
}

.crc-exempt-badge.limited {
    background: #fef3c7;
    color: #92400e;
}

/* Small Danger Button */
.crc-btn-danger-small {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.crc-btn-danger-small:hover {
    background: #fecaca;
    border-color: #f87171;
}

/* Pagination */
.crc-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px 0;
}

.crc-total-count {
    color: #6b7280;
    font-size: 14px;
}

.crc-pagination-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crc-page-info {
    color: #374151;
    font-size: 14px;
}

/* Loading & No Results */
.crc-loading,
.crc-no-results {
    text-align: center;
    padding: 60px 20px;
    background: #f9fafb;
    border-radius: 12px;
    color: #6b7280;
}

/* Modal Wide */
.crc-modal-content.crc-modal-wide {
    max-width: 500px;
}

/* Modal Description */
.crc-modal-description {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Form Row (two columns) */
.crc-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Form Group Inputs */
.crc-form-group input[type="text"],
.crc-form-group input[type="email"],
.crc-form-group input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.crc-form-group input[readonly] {
    background: #f9fafb;
    color: #6b7280;
}

/* Exempt Count Options */
.crc-exempt-count-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.crc-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .crc-exempt-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .crc-exempt-search {
        flex-direction: column;
    }

    .crc-exempt-table {
        font-size: 13px;
    }

    .crc-exempt-table th,
    .crc-exempt-table td {
        padding: 10px 12px;
    }

    .crc-form-row {
        grid-template-columns: 1fr;
    }

    .crc-main-tab {
        padding: 10px 16px;
        font-size: 14px;
    }
}
