/**
 * VMMS Custom Styles
 * Additional styles for Vending Machine Management System
 */

/* ========================================
   Status Badges - Enhanced Colors
   ======================================== */
.badge-initiated { background-color: #6c757d; }
.badge-in_progress { background-color: #17a2b8; }
.badge-dispensing { background-color: #007bff; }
.badge-completed { background-color: #28a745; }
.badge-failed { background-color: #dc3545; }
.badge-cancelled { background-color: #ffc107; color: #212529; }
.badge-expired { background-color: #343a40; }
.badge-timeout { background-color: #6c757d; }
.badge-refunded { background-color: #17a2b8; }

/* ========================================
   Card Enhancements
   ======================================== */
.card-hover {
    transition: all 0.3s ease-in-out;
}

.card-hover:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

/* ========================================
   Table Enhancements
   ======================================== */
.table-responsive {
    border-radius: 0.25rem;
}

.table-hover tbody tr {
    transition: background-color 0.2s ease-in-out;
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* ========================================
   Notification Styles
   ======================================== */
.notification-dropdown {
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease-in-out;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: #e7f3ff;
}

.notification-item.unread:hover {
    background-color: #d0e9ff;
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
    background-color: #dc3545;
    color: white;
}

/* ========================================
   Chart Containers
   ======================================== */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 20px;
}

/* ========================================
   Dashboard KPI Cards
   ======================================== */
.small-box {
    border-radius: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.small-box .icon {
    font-size: 70px;
}

.info-box {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
}

.info-box-icon {
    border-radius: 0.5rem 0 0 0.5rem;
}

/* ========================================
   Filter Cards
   ======================================== */
.filter-card .card-header {
    cursor: pointer;
    user-select: none;
}

.filter-card .card-header:hover {
    background-color: #f8f9fa;
}

/* ========================================
   Button Enhancements
   ======================================== */
.btn {
    border-radius: 0.25rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
}

/* ========================================
   Modal Enhancements
   ======================================== */
.modal-header {
    border-bottom: 2px solid #dee2e6;
}

.modal-footer {
    border-top: 2px solid #dee2e6;
}

/* ========================================
   Form Enhancements
   ======================================== */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.invalid-feedback {
    display: block;
    margin-top: 0.25rem;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ========================================
   Select2 Customization
   ======================================== */
.select2-container--bootstrap4 .select2-selection {
    border-color: #ced4da;
}

.select2-container--bootstrap4 .select2-selection:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* ========================================
   Alert Enhancements
   ======================================== */
.alert {
    border-radius: 0.5rem;
    border-left: 4px solid;
}

.alert-success { border-left-color: #28a745; }
.alert-danger { border-left-color: #dc3545; }
.alert-warning { border-left-color: #ffc107; }
.alert-info { border-left-color: #17a2b8; }

/* ========================================
   Pagination
   ======================================== */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: #007bff;
}

.page-link:hover {
    color: #0056b3;
}

.page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

/* ========================================
   Loading Spinner
   ======================================== */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* ========================================
   Empty States
   ======================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 4rem;
    color: #6c757d;
    margin-bottom: 20px;
}

.empty-state h4 {
    color: #6c757d;
    margin-bottom: 10px;
}

.empty-state p {
    color: #adb5bd;
}

/* ========================================
   Device Status Indicators
   ======================================== */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-indicator.online { background-color: #28a745; }
.status-indicator.offline { background-color: #dc3545; }
.status-indicator.maintenance { background-color: #ffc107; }

/* ========================================
   Stock Level Indicators
   ======================================== */
.stock-level {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.875rem;
    font-weight: 600;
}

.stock-level.high { background-color: #d4edda; color: #155724; }
.stock-level.medium { background-color: #fff3cd; color: #856404; }
.stock-level.low { background-color: #f8d7da; color: #721c24; }
.stock-level.out { background-color: #dc3545; color: white; }

/* ========================================
   Timeline (for transaction history)
   ======================================== */
.timeline {
    position: relative;
    padding: 0;
    list-style: none;
}

.timeline:before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
    left: 20px;
}

.timeline-item {
    position: relative;
    padding-left: 50px;
    margin-bottom: 20px;
}

.timeline-marker {
    position: absolute;
    left: 11px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #007bff;
}

.timeline-marker.success { background: #28a745; }
.timeline-marker.danger { background: #dc3545; }
.timeline-marker.warning { background: #ffc107; }

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
    .notification-dropdown {
        width: 280px;
    }
    
    .small-box .icon {
        font-size: 50px;
    }
    
    .chart-container {
        height: 250px;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
    
    .btn {
        display: none;
    }
}

/* ========================================
   Dark Mode Adjustments (if implemented)
   ======================================== */
.dark-mode .card {
    background-color: #343a40;
    color: #fff;
}

.dark-mode .table {
    color: #fff;
}

.dark-mode .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* ========================================
   Utility Classes
   ======================================== */
.cursor-pointer { cursor: pointer; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shadow-sm { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
.shadow { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1); }

/* ========================================
   Animation Classes
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.slide-down {
    animation: slideDown 0.3s ease-out;
}
