/* ===============================================
   VREYA - CSS PRENOTAZIONI DEDICATO
   Stili specifici per gestione prenotazioni cliente
   =============================================== */

/* ===============================================
   QUICK FILTER CHIPS
   =============================================== */
.quick-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 6px 16px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.filter-chip:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.filter-chip.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* ===============================================
   TAB NAVIGATION
   =============================================== */
.tabs-navigation {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--color-primary);
    background: rgba(45, 90, 61, 0.05);
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* TAB CONTENT */
.tabs-content {
    min-height: 400px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* PAGE SUBTITLE */
.page-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* ===============================================
   FILTRI SENZA RICERCA
   =============================================== */
.filters-container {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 24px;
    padding: 24px;
    background: var(--color-background);
    border-radius: 12px;
    border: 1px solid var(--color-border);
}

.filters-left {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.filter-select {
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-background);
    color: var(--color-text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.1);
}

/* ===============================================
   HEADER SEZIONE
   =============================================== */
.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 8px 0;
}

.section-subtitle {
    font-size: 16px;
    color: var(--color-secondary);
    margin: 0;
}

/* ===============================================
   COUNT BADGE
   =============================================== */
.count-badge {
    background: var(--color-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* ===============================================
   PRENOTAZIONI FUTURE - LISTA DETTAGLIATA
   =============================================== */
.bookings-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
}

.booking-item {
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.booking-item:hover {
    box-shadow: 0 8px 25px rgba(45, 90, 61, 0.1);
    transform: translateY(-2px);
}

.booking-item.confirmed {
    border-left: 4px solid var(--color-primary);
}

.booking-item.pending {
    border-left: 4px solid #f59e0b;
}

.booking-item.completed {
    border-left: 4px solid #52a373;
}

.booking-item.cancelled {
    border-left: 4px solid #ef4444;
    opacity: 0.8;
}

/* URGENCY BADGE */
.urgency-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #dc2626;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* DA RECENSIRE BADGE */
.review-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #d97706;
    margin-left: 8px;
}

.review-badge svg {
    color: #f59e0b;
}

/* EMPTY STATE */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state svg {
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 20px 0;
}

.empty-state-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

.empty-state-cta:hover {
    background: var(--color-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 90, 61, 0.2);
}

.booking-main {
    display: grid;
    grid-template-columns: 1fr auto 200px auto;
    gap: 24px;
    padding: 24px;
    align-items: center;
}

/* INFORMAZIONI SERVIZIO */
.booking-service-info {
    display: flex;
    gap: 16px;
    align-items: center;
}

.service-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-details h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 4px 0;
}

.service-description {
    font-size: 14px;
    color: var(--color-secondary);
    margin: 0 0 8px 0;
}

.service-meta {
    display: flex;
    gap: 16px;
    align-items: center;
}

.service-duration {
    font-size: 13px;
    color: var(--color-secondary);
    background: var(--color-gray-light);
    padding: 4px 8px;
    border-radius: 6px;
}

.service-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-primary);
}

/* DATA E ORA */
.booking-when {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.booking-date,
.booking-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--color-text);
    justify-content: center;
}

.booking-date svg,
.booking-time svg {
    color: var(--color-primary);
    flex-shrink: 0;
}

.countdown-mini {
    background: rgba(45, 90, 61, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
}

.countdown-label {
    font-size: 12px;
    color: var(--color-secondary);
    display: block;
}

.countdown-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-primary);
}

.pending-note {
    background: rgba(245, 158, 11, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
}

.pending-label {
    font-size: 12px;
    color: #f59e0b;
    font-weight: 600;
}

/* PROFESSIONISTA */
.booking-professional {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 200px;
}

.professional-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--color-primary);
}

.professional-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.professional-info h5 {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 2px 0;
}

.professional-info p {
    font-size: 12px;
    color: var(--color-secondary);
    margin: 0 0 4px 0;
}

.professional-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stars {
    display: flex;
    gap: 1px;
}

.star {
    font-size: 12px;
    color: #e5e7eb;
}

.star.filled {
    color: #fbbf24;
}

.rating-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
}

/* STATO PRENOTAZIONE */
.booking-status {
    text-align: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.confirmed {
    background: rgba(45, 90, 61, 0.1);
    color: var(--color-primary);
}

.status-badge.pending {
    background: rgba(251, 146, 60, 0.1);
    color: #fb923c;
}

.status-badge.completed {
    background: rgba(82, 163, 115, 0.1);
    color: #52a373;
}

.status-badge.cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.status-note {
    font-size: 11px;
    color: var(--color-secondary);
    margin: 4px 0 0 0;
}

/* AZIONI PRENOTAZIONE */
.booking-actions {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    background: var(--color-gray-light);
    border-top: 1px solid var(--color-border);
    justify-content: flex-end;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-decoration: none;
    width: auto;
    max-width: fit-content;
}

.btn-action.primary {
    background: var(--color-primary);
    color: white;
}

.btn-action.primary:hover {
    background: var(--color-dark);
    transform: translateY(-1px);
}

.btn-action.secondary {
    background: transparent;
    color: #fb923c;
    border: 1px solid #fb923c;
}

.btn-action.secondary:hover {
    background: #fb923c;
    color: white;
}

.btn-action.tertiary {
    background: transparent;
    color: #ef4444;
    border: 1px solid #ef4444;
}

.btn-action.tertiary:hover {
    background: #ef4444;
    color: white;
}

.btn-action.completed {
    background: #52a373;
    border: 1px solid #52a373;
    color: white;
}

.btn-action.completed:hover {
    background: var(--color-dark);
    transform: translateY(-1px);
}

.btn-action.pending {
    background: #fb923c;
    border: 1px solid #fb923c;
    color: white;
}

.btn-action.pending:hover {
    background: #f97316;
    transform: translateY(-1px);
}

.btn-action.cancelled {
    background: #ef4444;
    border: 1px solid #ef4444;
    color: white;
}

.btn-action.cancelled:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-action.info {
    background: transparent;
    color: var(--color-secondary);
    border: 1px solid var(--color-border);
}

.btn-action.info:hover {
    background: var(--color-secondary);
    color: white;
}

/* ===============================================
   STORICO - TABELLA COMPATTA
   =============================================== */
.history-table-container {
    padding: 24px;
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-background);
}

.history-table th {
    background: var(--color-gray-light);
    padding: 16px 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text);
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}

.history-table td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.history-item.completed {
    background: rgba(34, 197, 94, 0.02);
}

.history-item.cancelled {
    background: rgba(239, 68, 68, 0.02);
}

/* COMPONENTI TABELLA COMPATTI */
.service-compact {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 200px;
}

.service-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.service-compact-details h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 2px 0;
}

.service-compact-details p {
    font-size: 12px;
    color: var(--color-secondary);
    margin: 0;
}

.professional-compact {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 160px;
}

.professional-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--color-primary);
}

.professional-compact-details h6 {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 2px 0;
}

.rating-compact {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stars-compact {
    font-size: 11px;
    color: #fbbf24;
}

.rating-number {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text);
}

.date-compact {
    text-align: center;
    min-width: 100px;
}

.date-main {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.time-compact {
    display: block;
    font-size: 11px;
    color: var(--color-secondary);
    margin-top: 2px;
}

.price-amount {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
}

.price-amount.refunded {
    color: #ef4444;
    text-decoration: line-through;
}

.refund-note {
    display: block;
    font-size: 10px;
    color: #22c55e;
    margin-top: 2px;
    font-weight: 600;
}

/* AZIONI TABELLA */
.table-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.btn-table-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
}

.btn-table-action.review {
    color: #f59e0b;
    border: 1px solid #f59e0b;
}

.btn-table-action.review:hover {
    background: #f59e0b;
    color: white;
}

.btn-table-action.review.completed {
    color: #22c55e;
    border: 1px solid #22c55e;
}

.btn-table-action.repeat {
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.btn-table-action.repeat:hover {
    background: var(--color-primary);
    color: white;
}

.btn-table-action.details {
    color: var(--color-secondary);
    border: 1px solid var(--color-border);
}

.btn-table-action.details:hover {
    background: var(--color-secondary);
    color: white;
}

/* ===============================================
   PAGINAZIONE
   =============================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-top: 1px solid var(--color-border);
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    align-items: center;
}

.pagination-info {
    font-size: 14px;
    color: var(--color-secondary);
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */
@media (max-width: 1024px) {
    .booking-main {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .booking-professional {
        min-width: auto;
    }

    .filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .filters-left {
        flex-direction: column;
        gap: 16px;
    }

    .filter-group {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .bookings-list {
        padding: 16px;
        gap: 16px;
    }

    .booking-main {
        padding: 16px;
        gap: 16px;
    }

    .booking-service-info {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .service-image {
        width: 60px;
        height: 60px;
        margin: 0 auto;
    }

    .booking-when {
        gap: 6px;
    }

    .booking-professional {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .professional-avatar {
        width: 40px;
        height: 40px;
        margin: 0 auto;
    }

    .booking-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .btn-action {
        justify-content: center;
    }

    .history-table-container {
        padding: 16px;
    }

    .history-table {
        font-size: 13px;
    }

    .history-table th,
    .history-table td {
        padding: 12px 8px;
    }

    .service-compact {
        min-width: auto;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .service-thumb {
        width: 40px;
        height: 40px;
        margin: 0 auto;
    }

    .professional-compact {
        min-width: auto;
        flex-direction: column;
        text-align: center;
        gap: 6px;
    }

    .professional-thumb {
        width: 32px;
        height: 32px;
        margin: 0 auto;
    }

    .table-actions {
        flex-direction: column;
        gap: 4px;
    }

    .btn-table-action {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .filters-container {
        padding: 16px;
    }

    .filter-group {
        width: 100%;
    }

    .booking-main {
        padding: 12px;
    }

    .booking-actions {
        padding: 12px 16px;
    }

    .btn-action {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 100px;
    }

    .pagination {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .pagination-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===============================================
   ANIMAZIONI E TRANSIZIONI
   =============================================== */
.booking-item {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.booking-item:nth-child(1) {
    animation-delay: 0.1s;
}

.booking-item:nth-child(2) {
    animation-delay: 0.2s;
}

.booking-item:nth-child(3) {
    animation-delay: 0.3s;
}

.history-item {
    transition: background-color 0.3s ease;
}

.history-item:hover {
    background: rgba(45, 90, 61, 0.02) !important;
}

/* ===============================================
   STATI CARICAMENTO
   =============================================== */
.bookings-list.loading {
    opacity: 0.6;
    pointer-events: none;
}

.booking-item.updating {
    opacity: 0.7;
    transform: scale(0.98);
}

/* ===============================================
   FOCUS E ACCESSIBILITÀ
   =============================================== */
.filter-select:focus,
.btn-action:focus,
.btn-table-action:focus,
.pagination-btn:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ===============================================
   PRINT STYLES
   =============================================== */
@media print {

    .filters-container,
    .booking-actions,
    .table-actions,
    .pagination {
        display: none !important;
    }

    .booking-item,
    .content-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .history-table {
        width: 100% !important;
        font-size: 12px !important;
    }
}