/* Electricity Button */
.btn-electricity {
    background-color: #10b981;
    color: white;
    border-color: #10b981;
}

.btn-electricity:hover {
    background-color: #059669;
    border-color: #059669;
}

.btn-electricity-outline {
    background-color: transparent;
    color: #10b981;
    border-color: #10b981;
}

.btn-electricity-outline:hover {
    background-color: #10b981;
    color: white;
}

/* Electricity indicator */
.electricity-active {
    animation: pulse-electricity 2s infinite;
}

@keyframes pulse-electricity {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Custom CSS for Bazar Ramadan System */

/* Lot Box Styles */
.lot-box {
    width: 70px;
    height: 70px;
    margin: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.lot-available {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.lot-locked {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.lot-booked {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
    cursor: not-allowed;
}

.lot-selected {
    border: 3px solid #3498db !important;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

/* Status Badges */
.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.status-available {
    background-color: #d4edda;
    color: #155724;
}

.status-locked {
    background-color: #fff3cd;
    color: #856404;
}

.status-booked {
    background-color: #f8d7da;
    color: #721c24;
}

.status-pending {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-paid {
    background-color: #d4edda;
    color: #155724;
}

.status-approved {
    background-color: #c3e6cb;
    color: #155724;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

/* Custom Form Styles */
.required-field::after {
    content: " *";
    color: #e74c3c;
}

.form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

/* Custom Button Styles */
.btn-primary {
    background-color: #3498db;
    border-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
    border-color: #27ae60;
}

.btn-warning {
    background-color: #f39c12;
    border-color: #f39c12;
}

.btn-danger {
    background-color: #e74c3c;
    border-color: #e74c3c;
}

/* Custom Card Styles */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1rem;
}

.card-header {
    background-color: #2c3e50;
    color: white;
    font-weight: 600;
}

/* Zone Titles */
.zone-title {
    background-color: #f8f9fa;
    padding: 15px;
    margin-top: 25px;
    border-radius: 8px;
    border-left: 5px solid #3498db;
}

/* Animation for countdown */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.countdown-pulse {
    animation: pulse 1s infinite;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .table {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .table th, .table td {
        border: 1px solid #000 !important;
        color: #000 !important;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .lot-box {
        width: 50px;
        height: 50px;
        font-size: 0.8rem;
        margin: 3px;
    }
    
    .status-badge {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Custom Alert Colors */
.alert-custom {
    border-left: 5px solid;
}

.alert-info {
    border-left-color: #3498db;
}

.alert-warning {
    border-left-color: #f39c12;
}

.alert-danger {
    border-left-color: #e74c3c;
}

.alert-success {
    border-left-color: #27ae60;
}

/* Table Hover Effect */
.table-hover tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* PDF Viewer Container */
.pdf-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

/* File Upload Preview */
.file-preview {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-preview:hover {
    border-color: #3498db;
    background-color: #e3f2fd;
}

.file-preview i {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 10px;
}

/* Progress Bar Animation */
.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

/* Tooltip Customization */
.tooltip-inner {
    background-color: #2c3e50;
    color: white;
    border-radius: 4px;
    padding: 5px 10px;
}

.tooltip-arrow {
    border-top-color: #2c3e50 !important;
}

/* Modal Customization */
.modal-header {
    background-color: #2c3e50;
    color: white;
}

/* Custom Pagination */
.pagination .page-item.active .page-link {
    background-color: #3498db;
    border-color: #3498db;
}

.pagination .page-link {
    color: #3498db;
}

.pagination .page-link:hover {
    color: #2980b9;
}

/* Lot box styles */
.lot-box {
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 5px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    flex-direction: column;
    transition: all 0.3s;
    user-select: none;
}

.lot-box:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.lot-available {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.lot-locked {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.lot-booked {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    cursor: not-allowed;
}

.lot-selected {
    background-color: #007bff !important;
    border-color: #0056b3 !important;
    color: white !important;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0,123,255,0.5);
}

.lots-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Blink animation for countdown */
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.blink {
    animation: blink 1s infinite;
    font-weight: bold;
}

/* Debug border for testing */
.lot-box.debug {
    border: 1px solid red !important;
}

/* Better visual feedback */
.lot-box:not(.lot-booked) {
    cursor: pointer !important;
}

.lot-box.lot-booked {
    cursor: not-allowed !important;
    opacity: 0.7;
}

/* Selection animation */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 123, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

.lot-selected {
    animation: pulse 1.5s infinite;
}

/* Style for selection display */
#selectedAmount.d-none {
    display: none !important;
}

/* Make sure "Tiada" is always visible */
#selectedLotsDisplay:empty {
    color: #6c757d;
    font-style: italic;
}

/* Smooth transition for lot status changes */
.lot-box {
    transition: all 0.3s ease;
}

/* Blink animation untuk countdown */
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.blink {
    animation: blink 1s infinite;
    font-weight: bold;
}

#countdownAlert:not(.d-none) {
    display: flex !important;
    align-items: center;
    animation: fadeIn 0.5s ease-in;
}

/* Animation untuk fade in */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Blink animation untuk countdown kurang 2 minit */
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.blink {
    animation: blink 1s infinite;
    font-weight: bold;
}

/* PASTIKAN selectionInfo SENTIASA VISIBLE */
#selectionInfo {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Lot box styling */
.lot-box {
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 5px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    flex-direction: column;
    transition: all 0.3s;
}

.lot-box:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.lot-box.lot-available {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.lot-box.lot-locked {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.lot-box.lot-booked {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    cursor: not-allowed;
}

.lot-box.lot-selected {
    background-color: #007bff !important;
    border-color: #0056b3 !important;
    color: white !important;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0,123,255,0.5);
}

/* Receipt preview styles */
.file-preview {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s;
}

.file-preview:hover {
    border-color: #0d6efd;
    background: #e7f1ff;
}

.file-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.file-info {
    background: white;
    border-radius: 5px;
    padding: 10px;
    margin-top: 10px;
}

/* PDF viewer */
.pdf-viewer {
    width: 100%;
    height: 500px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Image preview modal */
#imageModal .modal-dialog {
    max-width: 90%;
}

#imageModal .modal-body {
    background: #f8f9fa;
}

/* File actions */
.file-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.file-action-btn {
    min-width: 120px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .file-actions {
        flex-direction: column;
    }
    
    .file-action-btn {
        width: 100%;
    }
}