/* ═══════════════════════════════════════════════════════════════
   SHARED: Voucher Component Styles v2.1
   Premium hotel voucher — multi-room, address, clean print
   
   CHANGES v2.1:
   - Multi-room section (.voucher-rooms-*)
   - Room cards with numbering
   - Provider footer badge
   - Removed old modal-actions / option selector
   - Action bar at bottom
   ═══════════════════════════════════════════════════════════════ */


/* ─── Voucher Action Bar (replaces bottom bar) ───────────────── */

.voucher-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 800;
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 8px 12px;
    padding-bottom: calc(8px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    background: rgba(12, 12, 20, 0.78);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-width: var(--app-max-width, 520px);
    margin: 0 auto;
}

.voucher-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 8px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.voucher-action-btn:active {
    transform: scale(0.97);
}

.voucher-action-btn.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25), inset 0 1px 0 rgba(255,255,255,0.15);
}

.voucher-action-btn.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
}

.voucher-action-btn.btn-secondary:active {
    background: rgba(255, 255, 255, 0.1);
}

.voucher-action-btn-icon {
    font-size: 16px;
    line-height: 1;
}

.voucher-action-btn-label {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.voucher-action-divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 0;
    flex-shrink: 0;
}


/* ─── Preview Container ──────────────────────────────────────── */

.voucher-preview {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}


/* ─── Voucher Document (white, for PDF capture) ──────────────── */

.voucher-document {
    background: #ffffff;
    color: #1a1a2e;
    padding: 24px 20px 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 1.5;
}


/* ─── Document Header ────────────────────────────────────────── */

.voucher-doc-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.voucher-logo {
    display: flex;
    align-items: center;
}

.voucher-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
    filter: invert(1);
}

.voucher-doc-type {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.voucher-type-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2.5px;
    color: #6b7280;
    text-transform: uppercase;
}

.voucher-type-status {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #059669;
    padding: 2px 8px;
    background: #ecfdf5;
    border-radius: 4px;
}


/* ─── Accent Line ────────────────────────────────────────────── */

.voucher-accent-line {
    height: 2px;
    background: linear-gradient(90deg, #1a1a2e 0%, #6366f1 50%, #1a1a2e 100%);
    margin-bottom: 16px;
    border-radius: 1px;
}


/* ─── Hotel Block ────────────────────────────────────────────── */

.voucher-hotel-block {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f5;
}

.voucher-hotel-name {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
    margin-bottom: 3px;
    letter-spacing: -0.01em;
}

.voucher-hotel-address {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}


/* ─── Dates Row ──────────────────────────────────────────────── */

.voucher-dates-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    margin-bottom: 14px;
    border-bottom: 1px solid #f0f0f5;
}

.voucher-date-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.voucher-date-col-right {
    text-align: right;
}

.voucher-date-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #9ca3af;
    text-transform: uppercase;
}

.voucher-date-value {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

.voucher-date-sep {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.voucher-date-nights {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1a1a2e;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.voucher-date-nights-label {
    font-size: 8px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* ─── Details Grid (single room) ─────────────────────────────── */

.voucher-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
}

.voucher-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f5;
    border-right: 1px solid #f0f0f5;
}

.voucher-detail:nth-child(even) {
    border-right: none;
}

.voucher-detail:nth-last-child(1),
.voucher-detail:nth-last-child(2) {
    border-bottom: none;
}

.voucher-detail-full {
    grid-column: 1 / -1;
    border-right: none;
}

.voucher-detail-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #9ca3af;
}

.voucher-detail-value {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a2e;
    word-break: break-word;
    line-height: 1.4;
}

.voucher-mono {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    letter-spacing: 0.3px;
}


/* ─── Multi-Room Section ─────────────────────────────────────── */

.voucher-rooms-section {
    margin-bottom: 14px;
}

.voucher-rooms-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px 10px 0 0;
    border-bottom: none;
}

.voucher-rooms-list {
    border: 1px solid #e5e7eb;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

.voucher-room-card {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f5;
}

.voucher-room-card:last-child {
    border-bottom: none;
}

.voucher-room-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.voucher-room-number {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #6366f1;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.voucher-room-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
}

.voucher-room-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    padding-left: 30px;
}

.voucher-room-detail {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.voucher-room-detail-label {
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #9ca3af;
}

.voucher-room-detail-value {
    font-size: 12px;
    font-weight: 500;
    color: #1a1a2e;
    line-height: 1.3;
}

.voucher-room-guests {
    grid-column: 1 / -1;
}


/* ─── Notice ─────────────────────────────────────────────────── */

.voucher-notice {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 12px 14px;
}

.voucher-notice-icon {
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1.4;
}

.voucher-notice-body {
    flex: 1;
    min-width: 0;
}

.voucher-notice-title {
    font-size: 12px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 3px;
}

.voucher-notice-text {
    font-size: 11px;
    color: #78350f;
    line-height: 1.5;
}


/* ─── Reference Block ────────────────────────────────────────── */

.voucher-ref-block {
    text-align: center;
    padding: 14px;
    margin-bottom: 10px;
    background: #f8fafc;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
}

.voucher-ref-label {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #9ca3af;
    margin-bottom: 5px;
}

.voucher-ref-value {
    font-size: 18px;
    font-weight: 800;
    font-family: 'SF Mono', 'Menlo', 'Courier New', monospace;
    letter-spacing: 2px;
    color: #1a1a2e;
}


/* ─── Document Footer ────────────────────────────────────────── */

.voucher-doc-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f5;
    font-size: 10px;
    color: #9ca3af;
}

.voucher-footer-dot {
    color: #d1d5db;
    font-size: 6px;
}


/* Hide old modal-actions in voucher, replaced by action bar */
#voucherModal .modal-actions {
    display: none !important;
}

#voucherModal .modal-body {
    padding-bottom: 100px;
}


/* ─── PDF Generation Overlay ─────────────────────────────────── */

.voucher-pdf-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    backdrop-filter: blur(4px);
}

.voucher-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: voucher-spin 0.8s linear infinite;
}

@keyframes voucher-spin {
    to { transform: rotate(360deg); }
}

.voucher-loading-text {
    font-size: 15px;
    color: #fff;
    font-weight: 500;
}


/* ─── Responsive ─────────────────────────────────────────────── */

@media (max-width: 360px) {
    .voucher-document {
        padding: 20px 16px 14px;
    }
    
    .voucher-hotel-name {
        font-size: 15px;
    }
    
    .voucher-date-value {
        font-size: 13px;
    }
    
    .voucher-detail {
        padding: 8px 10px;
    }
    
    .voucher-ref-value {
        font-size: 15px;
        letter-spacing: 1px;
    }
    
    .voucher-room-details {
        padding-left: 0;
    }
}
