/* Custom styles for Billing PS - v9.11 - Added rental preset cards & package cards for POS */

/* Custom Grid for More Cards Per Row */
@media (min-width: 1200px) {
    .col-xl-2-4 {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

@media (min-width: 1400px) {
    .col-xl-2-4 {
        flex: 0 0 16.666667%;
        max-width: 16.666667%;
    }
}

/* Loading Spinner Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ph-spinner {
    animation: spin 1s linear infinite;
}

/* Modern TV Card Styles - Compact */
.tv-card {
    border: none;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    height: 100%;
}

/* Idle State - Green Card */
.tv-card-idle {
    background: linear-gradient(135deg, #00c853 0%, #00e676 100%);
    box-shadow: 0 4px 16px rgba(0, 200, 83, 0.2);
}

.tv-card-idle:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 200, 83, 0.3);
}

/* Booked Rental - Yellow Card */
.tv-card-booked {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.2);
}

.tv-card-booked:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.3);
}

/* Active Rental - Orange Card */
.tv-card-active {
    background: linear-gradient(135deg, #ff6f00 0%, #ff9100 100%);
    box-shadow: 0 4px 16px rgba(255, 111, 0, 0.2);
}

.tv-card-active:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 111, 0, 0.3);
}

/* Timeout Unpaid - Purple Card */
.tv-card-timeout {
    background: linear-gradient(135deg, #7c4dff 0%, #b388ff 100%);
    box-shadow: 0 4px 16px rgba(124, 77, 255, 0.25);
}

.tv-card-timeout:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(124, 77, 255, 0.35);
}

.tv-card-timeout .timer-display {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.tv-card-timeout .badge-timeout {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-weight: 600;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    animation: pulse-timeout 2s ease-in-out infinite;
}

@keyframes pulse-timeout {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.tv-card .card-body {
    color: white;
    padding: 1rem;
}

.tv-card h5 {
    color: white !important;
    opacity: 0.95;
    font-size: 1rem;
    font-weight: 600;
}

.tv-card small,
.tv-card .text-muted {
    color: white !important;
    opacity: 0.9;
    font-size: 0.75rem;
}

/* Compact Timer Display */
.timer-display {
    text-align: center;
    padding: 12px 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 10px;
}

.timer-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    letter-spacing: 2px;
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.timer-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.9;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Status Badge in Timer */
.timer-status {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    backdrop-filter: blur(10px);
}

/* Status Playing - Green and Blinking */
.timer-status.status-playing {
    background: #4caf50;
    color: white;
    animation: statusBlink 1.5s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

/* Status Booked - Yellow/Gold */
.timer-status.status-booked {
    background: #ff9800;
    color: white;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
}

@keyframes statusBlink {
    0%, 100% { 
        opacity: 1; 
        background: #4caf50;
    }
    50% { 
        opacity: 0.6; 
        background: #66bb6a;
    }
}

/* Compact Session Details */
.session-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 10px;
    gap: 6px;
}

/* Session Details for Idle (Green Card) - Light Green Solid */
.tv-card-idle .session-details {
    background: #a5d6a7;
    border: 1px solid #81c784;
}

.tv-card-idle .session-detail-item {
    background: #c8e6c9;
    border: 1px solid #a5d6a7;
    color: #1b5e20;
}

.tv-card-idle .session-detail-label {
    color: #2e7d32;
}

.tv-card-idle .session-detail-value {
    color: #1b5e20;
}

/* Session Details for Active (Orange Card) - Light Orange Solid */
.tv-card-active .session-details {
    background: #ffcc80;
    border: 1px solid #ffb74d;
}

.tv-card-active .session-detail-item {
    background: #ffe0b2;
    border: 1px solid #ffcc80;
    color: #e65100;
}

.tv-card-active .session-detail-label {
    color: #ef6c00;
}

.tv-card-active .session-detail-value {
    color: #e65100;
}

.session-detail-item {
    flex: 1 1 45%;
    text-align: center;
    padding: 4px 8px;
    min-width: 0;
    border-radius: 6px;
    transition: all 0.2s ease;
}

/* Mobile compact billing cards (2 per row) */
@media (max-width: 767.98px) {
    .tv-card .card-body {
        padding: 0.6rem;
    }
    .tv-card h5 {
        font-size: 0.78rem;
    }
    .timer-display {
        padding: 6px 4px;
        margin-bottom: 6px;
    }
    .timer-value {
        font-size: 1.2rem;
        letter-spacing: 1px;
        margin-bottom: 4px;
    }
    .timer-label {
        font-size: 0.55rem;
        letter-spacing: 1px;
        margin-bottom: 4px;
    }
    .timer-status {
        font-size: 0.5rem;
        padding: 2px 6px;
    }
    .session-details {
        padding: 4px 4px;
        gap: 3px;
    }
    .session-detail-item {
        padding: 2px 4px;
    }
    .session-detail-label {
        font-size: 0.55rem !important;
    }
    .session-detail-value {
        font-size: 0.65rem !important;
    }
    .tv-card .btn-sm {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    .tv-card .btn-group-sm > .btn {
        font-size: 0.65rem;
        padding: 0.2rem 0.35rem;
    }
}

/* ═══ Mobile Bottom Navigation ═══ */
#mobile-bottom-nav {
    display: none;
}

@media (max-width: 767.98px) {
    #mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1050;
        background: #fff;
        border-top: 1px solid #e0e0e0;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
        justify-content: space-around;
        align-items: center;
        padding: 6px 0;
        padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #888;
        font-size: 0.7rem;
        font-weight: 600;
        padding: 4px 20px;
        border-radius: 10px;
        transition: all 0.2s ease;
        gap: 2px;
    }

    .mobile-nav-item i {
        font-size: 1.4rem;
    }

    .mobile-nav-item.active {
        color: #4e73df;
        background: rgba(78, 115, 223, 0.1);
    }

    .mobile-nav-item:hover {
        color: #4e73df;
        text-decoration: none;
    }

    /* Add bottom spacing to content so it's not hidden behind nav */
    .pc-container {
        padding-bottom: 70px;
    }

    .pc-footer {
        margin-bottom: 60px;
    }
}

.session-detail-item:not(:last-child) {
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

/* Remove border for items on second row */
@media (max-width: 1200px) {
    .session-detail-item:nth-child(2) {
        border-right: 1px solid rgba(255, 255, 255, 0.4);
    }
    .session-detail-item:nth-child(3),
    .session-detail-item:nth-child(4) {
        margin-top: 4px;
        border-top: 1px solid rgba(255, 255, 255, 0.4);
        padding-top: 4px;
    }
}

.session-detail-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 1;
    margin-bottom: 3px;
    font-weight: 700;
    white-space: nowrap;
    text-shadow: none;
}

.session-detail-value {
    font-size: 0.8rem;
    font-weight: 700;
    opacity: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-shadow: none;
}

.rental-session-info {
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Rental Modal Preset Buttons */
.rental-preset-btn {
    padding: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.rental-preset-btn:hover {
    transform: scale(1.05);
}

.rental-preset-btn.active {
    background-color: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
    box-shadow: 0 4px 12px rgba(38, 137, 226, 0.3);
}

/* Rental Preset Cards (for POS modal) */
.rental-preset-card {
    padding: 15px 10px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    border-width: 2px;
}

.rental-preset-card i {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.rental-preset-card:hover {
    transform: scale(1.05);
}

.rental-preset-card.active {
    background-color: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
    box-shadow: 0 4px 12px rgba(38, 137, 226, 0.3);
}

/* Package Cards (for POS modal) */
.package-card-btn {
    padding: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    border-width: 2px;
    text-align: left;
}

.package-card-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.package-card-btn.active {
    background-color: var(--bs-info);
    color: white;
    border-color: var(--bs-info);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

/* Mode Selection Buttons */
.mode-btn {
    padding: 15px 10px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    transform: scale(1.02);
}

.mode-btn.active {
    background-color: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
    box-shadow: 0 4px 12px rgba(38, 137, 226, 0.3);
}

.mode-btn[data-mode="open"].active {
    background-color: var(--bs-success);
    border-color: var(--bs-success);
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

/* Extend Modal Preset Buttons */
.extend-preset-btn {
    padding: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.extend-preset-btn:hover {
    transform: scale(1.05);
}

.extend-preset-btn.active {
    background-color: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
    box-shadow: 0 4px 12px rgba(38, 137, 226, 0.3);
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-offline {
    background-color: #fee;
    color: #d32f2f;
}

.status-online {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-playing {
    background-color: #fff3e0;
    color: #ef6c00;
}

/* Button Improvements for Active Cards */
.card-rental-active .btn {
    font-weight: 600;
    border-width: 2px;
}

.card-rental-active .btn-warning {
    background-color: rgba(255, 193, 7, 0.95);
    border-color: white;
    color: #333;
}

.card-rental-active .btn-warning:hover {
    background-color: #ffc107;
    transform: translateY(-1px);
}

.card-rental-active .btn-info {
    background-color: rgba(62, 201, 214, 0.95);
    border-color: white;
    color: white;
}

.card-rental-active .btn-info:hover {
    background-color: #3ec9d6;
    transform: translateY(-1px);
}

.card-rental-active .btn-danger {
    background-color: rgba(244, 67, 54, 0.95);
    border-color: white;
}

.card-rental-active .btn-danger:hover {
    background-color: #f44336;
    transform: translateY(-1px);
}

.card-rental-active .btn-success {
    background-color: rgba(255, 255, 255, 0.95);
    border-color: white;
    color: #00c853;
}

.card-rental-active .btn-success:hover {
    background-color: white;
    transform: translateY(-1px);
}

/* Smooth transitions */
.card {
    transition: all 0.3s ease;
}

/* Paused State - Yellow tint */
.card-rental-active.paused {
    background: linear-gradient(135deg, #ffc107 0%, #ffeb3b 100%);
}

.card-rental-active.paused .timer-display {
    color: #ff6f00;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Extend Modal Styling */
#extendModal .modal-body {
    padding: 2rem;
}

#extendModal .alert-info {
    background-color: #e3f2fd;
    border-color: #90caf9;
    color: #1976d2;
}

#extend-calculated-price {
    color: #1976d2;
}

/* Modal z-index fix - ensure modal appears above backdrop */
#rentalModal {
    z-index: 1060 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

#rentalModal .modal-dialog {
    z-index: 1061 !important;
    position: relative !important;
    margin: 1.75rem auto !important;
    pointer-events: auto !important;
}

#rentalModal .modal-content {
    position: relative !important;
    background-color: #fff !important;
    border: 1px solid rgba(0,0,0,.2) !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15) !important;
}

.modal-backdrop {
    z-index: 1050 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
}

.modal.show {
    display: block !important;
}

.modal-dialog-centered {
    display: flex !important;
    align-items: center !important;
    min-height: calc(100% - 3.5rem) !important;
}

/* Price updating animation for Open Play */
@keyframes priceUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.price-updating {
    animation: priceUpdate 0.3s ease-in-out;
}

/* Open Play specific styles */
.session-detail-value[style*="color: rgb(40, 167, 69)"] {
    text-shadow: 0 0 8px rgba(40, 167, 69, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .timer-display {
        font-size: 1.5rem;
    }
    
    .extend-preset-btn {
        padding: 8px;
        font-size: 0.875rem;
    }
}

/* iPad and Tablet optimizations (1024px - 1366px) */
@media (min-width: 768px) and (max-width: 1400px) {
    /* Reduce session details text size */
    .session-detail-label {
        font-size: 0.5rem;
        letter-spacing: 0.3px;
        margin-bottom: 1px;
    }
    
    .session-detail-value {
        font-size: 0.65rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Reduce padding to fit more content */
    .session-details {
        padding: 6px 5px;
    }
    
    .session-detail-item {
        padding: 0 3px;
        min-width: 0; /* Allow flex items to shrink */
    }
    
    /* Reduce timer size */
    .timer-display {
        margin-bottom: 8px;
    }
    
    .timer-value {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    
    .timer-label {
        font-size: 0.6rem;
        margin-top: 2px;
    }
    
    .timer-status {
        font-size: 0.6rem;
        padding: 2px 8px;
        margin-top: 3px;
    }
    
    /* Card body padding */
    .tv-card .card-body {
        padding: 12px;
    }
    
    /* Device name size */
    .tv-card h5 {
        font-size: 0.95rem;
    }
    
    /* Console type */
    .tv-card small {
        font-size: 0.7rem;
    }
}

/* Extra small devices optimization */
@media (max-width: 1024px) {
    .session-detail-label {
        font-size: 0.5rem;
    }
    
    .session-detail-value {
        font-size: 0.6rem;
    }
}

/* POS Payment Method Card Hover Effect */
.payment-method-card {
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0;
}

.payment-method-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--bs-primary);
}

.payment-method-card:active {
    transform: translateY(-2px);
}

/* Report table clickable rows */
.table-hover tbody tr[onclick] {
    transition: background-color 0.15s ease;
}
.table-hover tbody tr[onclick]:hover {
    background-color: rgba(33, 150, 243, 0.04) !important;
}
.table-hover tbody tr[onclick]:hover td code {
    text-decoration: underline;
}

/* ═══ Loading button spinner for small buttons ═══ */
.btn-group-sm .btn .spinner-border {
    width: 0.85rem;
    height: 0.85rem;
    border-width: 0.15em;
    margin: 0;
}
.btn[disabled] {
    opacity: 0.75;
    cursor: not-allowed;
}

