/**
 * REG-SUPPORT Custom Styles
 * ================================================
 * Custom CSS for additional functionality and styling
 * Author: Registration Office CMU
 * Last Updated: 2025-10-14
 */

/* ===== DataTable Customization ===== */

/* Compact padding for table cells */
table.dataTable tbody td {
    padding: 4px 8px !important;
}

table.dataTable thead th {
    padding: 6px 10px !important;
}

/* ===== Stock Status Colors ===== */

/* Low stock warning - red tint */
.low-stock {
    background-color: rgba(220, 53, 69, 0.1) !important;
    /* background-color: #f8d7da !important; */
}

.low-stock:hover {
    background-color: rgba(220, 53, 69, 0.2) !important;
    /* background-color: #f5c6cb !important; */
}

/* Minimum stock warning - yellow tint */
.min-stock {
    background-color: rgba(255, 193, 7, 0.15) !important;
    /* background-color: #fff3cd !important; */
}

.min-stock:hover {
    background-color: rgba(255, 193, 7, 0.25) !important;
    /* background-color: #ffe69c !important; */
}

/* ===== Image Styles ===== */

/* Equipment image thumbnail in tables */
.equip-img-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.equip-img-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ===== Button Styles ===== */

/* Button action group layout */
.btn-action-group {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-icon-split .icon {
    padding: 0.375rem 0.5rem;
}

.btn-icon-split .text {
    padding: 0.375rem 0.75rem;
}

/* Button hover effects */
.btn-icon-split:hover {
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* ===== Form Styles ===== */

/* Select2 custom item layout */
.select2-item {
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.select2-item .text-left {
    flex: 1;
}

.select2-item .text-right {
    white-space: nowrap;
    margin-left: 10px;
}

/* ===== Card Styles ===== */

.card-equip-detail {
    border-radius: 8px;
    overflow: hidden;
}

.card-equip-detail .card-header {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
}

/* Info section for equipment detail */
.info-section {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

.info-row {
    margin-bottom: 0.3rem;
}

/* Form styles */
.form-label-custom {
    font-weight: 500;
    color: #495057;
}

.form-control-custom,
.form-control-custom-file {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
}

.form-control-custom:focus,
.form-control-custom-file:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.total-calculation {
    background-color: #e9ecef;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
}

/* Takeout statistics section */
.takeout-stats-table {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.takeout-stats-table .table {
    background-color: white;
    margin-bottom: 0;
}

.takeout-stats-table .card-header {
    background-color: rgba(255,255,255,0.9);
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.takeout-stats-section {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

/* Equipment image */
.equipment-image {
    transition: transform 0.2s;
    cursor: pointer;
}

.equipment-image:hover {
    transform: scale(1.05);
}

/* Stock warning indicator */
.stock-warning {
    cursor: help;
}

/* Statistics card with gradient */
.statistics-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Transaction table */
.transaction-table {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.transaction-row:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

.badge-transaction {
    padding: 5px 10px;
    border-radius: 5px;
}

/* Timeline indicators */
.timeline-dot {
    width: 12px;
    height: 12px;
    background-color: #28a745;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.timeline-dot-red {
    width: 12px;
    height: 12px;
    background-color: #dc3545;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

/* No data messages */
.no-data-message {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.no-data-message-white {
    text-align: center;
    padding: 40px;
    color: #ffffff;
}

/* Select2 customization */
.select2-item {
    width: 100%;
    padding-right: 5px;
}

.select2-container--bootstrap4 .select2-results__option {
    padding: 6px 12px;
}

/* ===== Alert Styles ===== */

.alert-stock-low {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-stock-min {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

/* ===== Responsive Styles ===== */

@media (max-width: 768px) {
    /* Hide button text on mobile, show icons only */
    .btn-action-group {
        flex-direction: column;
    }
    
    .btn-icon-split .text {
        display: none;
    }
    
    /* Adjust table for mobile */
    table.dataTable tbody td {
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    /* Extra small devices */
    .equip-img-thumb {
        width: 40px;
        height: 40px;
    }
}

/* ===== Animation Styles ===== */

.animation-highlight {
    transition: all 0.3s ease;
}

.animation-highlight:hover {
    transform: translateY(-2px);
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Utility Classes ===== */

/* Shadow effects */
.shadow-sm-custom {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.shadow-md-custom {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.shadow-lg-custom {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2) !important;
}

/* Text utilities */
.text-nowrap-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Spacing utilities */
.gap-sm {
    gap: 0.5rem;
}

.gap-md {
    gap: 1rem;
}

.gap-lg {
    gap: 1.5rem;
}

/* ===== SweetAlert2 Customization ===== */

.swal2-popup {
    font-family: 'Bai Jamjuree', sans-serif;
    border-radius: 8px;
}

.swal2-title {
    font-weight: 600;
}

.swal2-html-container {
    font-size: 0.95rem;
}

/* ===== Lightbox Customization ===== */

.lb-data .lb-caption {
    font-family: 'Bai Jamjuree', sans-serif;
    font-size: 14px;
}

.lb-data .lb-number {
    font-family: 'Bai Jamjuree', sans-serif;
}

/* ===== Tooltip Customization ===== */

.tooltip-inner {
    font-family: 'Bai Jamjuree', sans-serif;
    font-size: 0.875rem;
}

/* ===== Badge Customization ===== */

.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.badge-stock-normal {
    background-color: #1cc88a;
    color: white;
}

.badge-stock-low {
    background-color: #e74a3b;
    color: white;
}

.badge-stock-min {
    background-color: #f6c23e;
    color: #333;
}

/* ===== Loading Overlay ===== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4e73df;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
