/* Stock Report - Excel-like Grid Styles */

.filters-section {
    background: #f8f9fc;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #e3e6f0;
}

.filters-section label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #5a5c69;
    margin-bottom: 5px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Table Styles - Excel-like appearance */
#stockTable {
    font-size: 0.875rem;
    border-collapse: separate;
    border-spacing: 0;
}

#stockTable thead th {
    background: linear-gradient(180deg, #4e73df 0%, #224abe 100%);
    color: white;
    font-weight: 600;
    border: 1px solid #3559c7;
    padding: 12px 8px;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

#stockTable thead th.editable-col {
    background: linear-gradient(180deg, #1cc88a 0%, #13855c 100%);
    border: 1px solid #0e6b4a;
}

#stockTable thead th.editable-col::after {
    content: " ✎";
    font-size: 0.9rem;
}

#stockTable tbody td {
    padding: 8px;
    border: 1px solid #e3e6f0;
    background: white;
    vertical-align: middle;
}

#stockTable tbody tr:hover {
    background-color: #f8f9fc;
}

/* Editable cells styling */
.editable-cell {
    cursor: pointer;
    position: relative;
    background-color: #e7f4f0 !important;
    transition: all 0.2s ease;
}

.editable-cell:hover {
    background-color: #d1f0e5 !important;
    box-shadow: inset 0 0 0 2px #1cc88a;
}

.editable-cell.editing {
    padding: 0 !important;
    background-color: white !important;
    box-shadow: inset 0 0 0 2px #4e73df;
}

.editable-cell input {
    width: 100%;
    height: 100%;
    border: none;
    padding: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    background: white;
    outline: none;
}

.editable-cell input:focus {
    background: #fffbeb;
}

/* Stock Status Badges */
.stock-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stock-status.in-stock {
    background-color: #d1f0e5;
    color: #13855c;
    border: 1px solid #1cc88a;
}

.stock-status.low-stock {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.stock-status.out-of-stock {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #dc3545;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active {
    background-color: #d1f0e5;
    color: #13855c;
}

.status-badge.inactive {
    background-color: #e2e3e5;
    color: #6c757d;
}

/* Actions Column */
.action-btns {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btns .btn {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.action-btns .btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    transform: scale(1.05);
}

/* Alert Messages */
#alertContainer {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 400px;
}

.alert-floating {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.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); }
}

/* Number formatting */
.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center !important;
}

.font-weight-bold {
    font-weight: 700 !important;
}

/* Footer totals */
#stockTable tfoot tr {
    background: linear-gradient(180deg, #36b9cc 0%, #258391 100%);
    color: white;
}

#stockTable tfoot td {
    padding: 12px 8px;
    border: 1px solid #1f7a8a;
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .filters-section .col-md-2,
    .filters-section .col-md-3 {
        margin-bottom: 10px;
    }
    
    #stockTable {
        font-size: 0.75rem;
    }
    
    #stockTable thead th,
    #stockTable tbody td {
        padding: 6px 4px;
    }
    
    .action-btns {
        flex-direction: column;
    }
}

/* DataTables custom styling */
.dataTables_wrapper .dataTables_length select {
    padding: 5px;
    border-radius: 4px;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 4px;
    padding: 5px 10px;
    border: 1px solid #d1d3e2;
}

.dataTables_wrapper .dataTables_info {
    padding-top: 15px;
    font-size: 0.85rem;
    color: #858796;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 15px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 5px 10px;
    margin: 0 2px;
    border-radius: 4px;
    border: 1px solid #d1d3e2;
    background: white;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #4e73df;
    color: white !important;
    border-color: #4e73df;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #4e73df;
    color: white !important;
    border-color: #4e73df;
}

/* Excel export button styling */
#exportExcel {
    background: #1e7e34;
    border-color: #1e7e34;
}

#exportExcel:hover {
    background: #145523;
    border-color: #145523;
}

/* Highlight changed cells */
.cell-changed {
    animation: highlightChange 1s ease;
}

@keyframes highlightChange {
    0% {
        background-color: #fff3cd;
    }
    100% {
        background-color: #e7f4f0;
    }
}

/* Tooltip for editable cells */
.editable-cell::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: #2c3e50;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.editable-cell:hover::before {
    opacity: 1;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #858796;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h5 {
    margin-bottom: 10px;
    color: #5a5c69;
}
