﻿/* Main Styles for Inang Susan Multi-serve Corporation */

/* Global Styles */
:root {
    --primary-brown: #8B4513;
    --secondary-brown: #654321;
    --accent-gold: #DAA520;
    --light-gold: #FFD700;
    --pale-gold: #FFF8DC;
}

/* Sidebar Dropdown Styles */
.sidebar .dropdown-menu {
    background-color: #5a5c69;
    border: none;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    margin-left: 0.5rem;
    margin-top: 0.2rem;
}

.sidebar .dropdown-item {
    color: #d1d3e2;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    transition: all 0.15s ease-in-out;
}

.sidebar .dropdown-item:hover,
.sidebar .dropdown-item:focus {
    background-color: #484e5d;
    color: #fff;
}

.sidebar .dropdown-item.active {
    background-color: var(--accent-gold);
    color: #fff;
}

.sidebar .dropdown-item i {
    width: 1rem;
    text-align: center;
}

.sidebar .nav-link.dropdown-toggle {
    position: relative;
}

.sidebar .nav-link.dropdown-toggle::after {
    float: right;
    margin-top: 0.5rem;
    margin-right: 0.5rem;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container-fluid {
    flex: 1;
}

footer {
    margin-top: auto;
}

/* Dashboard Styles */
.card-dashboard {
    transition: all 0.3s ease;
    border-left: 4px solid var(--accent-gold);
}

.card-dashboard:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(139, 69, 19, 0.2);
}

.card-dashboard .card-body {
    padding: 1.5rem;
}

.card-dashboard .card-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #6c757d;
    font-weight: 600;
}

.card-dashboard .card-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0;
}

.card-dashboard .card-icon {
    font-size: 2.5rem;
    opacity: 0.3;
}

/* Inventory Styles */
.product-card {
    border-radius: 10px;
    transition: all 0.2s ease-in-out;
}

.product-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.low-stock {
    color: #dc3545;
}

.catch-weight-badge {
    background-color: #6f42c1;
    color: white;
}

/* POS Styles */
.product-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

.product-item:hover {
    background-color: var(--pale-gold);
}

.cart-item {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Compact POS UI Styles */
.pos-compact {
    font-size: 0.9rem;
}

.pos-compact .card {
    border-radius: 0.25rem;
}

.pos-compact .card-header {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.pos-compact .card-body {
    padding: 0.75rem;
}

.pos-compact .card-footer {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid #dee2e6;
}

.pos-compact .form-control {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.pos-compact .form-select {
    padding: 0.25rem 2rem 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.pos-compact .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.pos-compact .btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1rem;
}

.pos-compact .input-group-text {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.pos-compact .list-group-item {
    padding: 0.5rem 0.75rem;
}

.pos-compact .mb-3 {
    margin-bottom: 0.75rem !important;
}

.pos-compact .mb-2 {
    margin-bottom: 0.5rem !important;
}

.pos-compact .form-label {
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.pos-compact .alert {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.pos-compact .pagination {
    --bs-pagination-padding-x: 0.5rem;
    --bs-pagination-padding-y: 0.25rem;
    --bs-pagination-font-size: 0.875rem;
}

.pos-compact .product-grid-item {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pos-compact .product-grid-item:hover {
    background-color: var(--pale-gold);
    border-color: var(--accent-gold);
}

.pos-compact .cart-summary {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.25rem;
    margin-bottom: 0.75rem;
}

.pos-compact .cart-summary .row {
    margin-bottom: 0.25rem;
}

.pos-compact .cart-summary .row:last-child {
    margin-bottom: 0;
    font-weight: 600;
    border-top: 1px solid #dee2e6;
    padding-top: 0.5rem;
}

/* Responsive adjustments for small screens */
@media (max-width: 768px) {
    .pos-compact {
        font-size: 0.8rem;
    }
    
    .pos-compact .card-header {
        padding: 0.375rem 0.5rem;
    }
    
    .pos-compact .card-body {
        padding: 0.5rem;
    }
    
    .pos-compact .form-control,
    .pos-compact .form-select {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .pos-compact .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .pos-compact .btn-lg {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* Login Form */
.login-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Full width table optimizations */
.table-full-width {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.table-full-width .table-responsive {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Customer page specific optimizations */
.customer-page .card {
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.customer-page .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.customer-page .table {
    margin-bottom: 0;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .customer-page .table {
        white-space: normal;
        font-size: 0.875rem;
    }
    
    .customer-page .table td,
    .customer-page .table th {
        padding: 0.5rem 0.25rem;
        vertical-align: middle;
    }
}

/* Responsive tables */
.table-responsive {
    overflow-x: auto;
}

/* Form validation styles */
.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s;
}

.spinner-overlay.show {
    visibility: visible;
    opacity: 1;
}

/* Date picker custom style */
.datepicker-dropdown {
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

/* Unified Toast notifications styling */
.toast-container {
    z-index: 9999 !important;
    pointer-events: none;
    max-width: 400px;
}

.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 400px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    margin-bottom: 0.75rem;
    backdrop-filter: blur(10px);
    border-radius: 0.5rem;
    border: none !important;
    animation: slideInUp 0.3s ease-out;
}

.toast.show {
    animation: slideInDown 0.3s ease-out;
}

.toast.hide {
    animation: slideOutUp 0.3s ease-in forwards;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-100%);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast-body {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
}

.toast-body i {
    margin-right: 0.5rem;
    font-size: 1rem;
    flex-shrink: 0;
}

.btn-close {
    margin: 0.5rem;
    filter: none;
    opacity: 0.8;
}

.btn-close:hover {
    opacity: 1;
}

/* Toast color variants */
.toast.bg-success {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%) !important;
}

.toast.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%) !important;
}

.toast.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
    color: #212529 !important;
}

.toast.bg-warning .btn-close {
    filter: invert(1) grayscale(100%) brightness(0);
}

.toast.bg-info {
    background: linear-gradient(135deg, #0dcaf0 0%, #0aa4c7 100%) !important;
}

.toast.bg-primary {
    background: linear-gradient(135deg, var(--primary-brown) 0%, var(--secondary-brown) 100%) !important;
}

/* Orders Page Specific Styles */
.border-left-primary {
    border-left: 4px solid var(--primary-brown) !important;
}

.border-left-success {
    border-left: 4px solid #28a745 !important;
}

.border-left-warning {
    border-left: 4px solid #ffc107 !important;
}

.border-left-info {
    border-left: 4px solid #17a2b8 !important;
}

.metric-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    gap: 0.25rem;
}

.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.category-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.trend-up {
    color: #28a745;
}

.trend-down {
    color: #dc3545;
}

.trend-neutral {
    color: #6c757d;
}

/* Orders table improvements */
.recent-orders-table tbody tr:hover {
    background-color: rgba(139, 69, 19, 0.05);
    cursor: pointer;
}

/* Modal improvements */
.modal-lg {
    max-width: 900px;
}

.table-borderless td {
    border: none;
    padding: 0.25rem 0.5rem;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .metric-icon {
        width: 40px;
        height: 40px;
    }
    
    .card-dashboard .card-value {
        font-size: 1.5rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.125rem 0.25rem;
        font-size: 0.75rem;
    }
}

/* Cutoff Page Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading states */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Smooth transitions */
.card-body {
    transition: opacity 0.2s ease;
}

.alert {
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Mobile responsive styles for toasts */
@media (max-width: 576px) {
    .toast-container {
        left: 1rem !important;
        right: 1rem !important;
        top: 1rem !important;
        transform: none !important;
        max-width: none !important;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
        max-width: none;
        margin-bottom: 0.5rem;
    }
    
    .toast-body {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .toast-body i {
        font-size: 0.875rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .toast {
        border: 2px solid currentColor;
        box-shadow: none;
    }
    
    .toast.bg-warning {
        color: #000 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .toast {
        animation: none;
    }
    
    .toast.show {
        animation: none;
    }
    
    .toast.hide {
        animation: none;
    }
}

/* Custom styles for brown and gold theme */
.btn-primary {
    background-color: var(--primary-brown);
    border-color: var(--primary-brown);
}

.btn-primary:hover {
    background-color: var(--secondary-brown);
    border-color: var(--secondary-brown);
}

.btn-outline-primary {
    color: var(--primary-brown);
    border-color: var(--primary-brown);
}

.btn-outline-primary:hover {
    background-color: var(--primary-brown);
    border-color: var(--primary-brown);
    color: white;
}

.nav-link.active {
    color: var(--accent-gold) !important;
}


.table thead {
    background-color: var(--pale-gold);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-brown);
    border-color: var(--primary-brown);
}

.pagination .page-link {
    color: var(--primary-brown);
}

.pagination .page-link:hover {
    background-color: var(--pale-gold);
    color: var(--secondary-brown);
}

a {
    color: var(--primary-brown);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover, a:focus {
    color: var(--accent-gold);
    text-decoration: underline;
}

a:active {
    color: var(--secondary-brown);
}

/* Stock Distribution Modal Styles */
#stockDistributionModal .modal-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

#stockDistributionModal .modal-header h5,
#stockDistributionModal .modal-header .modal-title {
    color: white !important;
}

/* Product name and details in modal header - make highly visible */
#stockDistributionModal #distributionProductName {
    font-weight: bold;
    font-size: 1.25rem;
    color: #000;
}

#stockDistributionModal #distributionProductSku,
#stockDistributionModal #distributionCurrentStock {
    color: #000;
    font-size: 0.9rem;
}

/* Table content visibility improvements */
#stockDistributionModal .table td,
#stockDistributionModal .table th {
    color: #212529 !important;
}

/* Badge text visibility */
#stockDistributionModal .badge.bg-light {
    color: #212529 !important;
    background-color: #f8f9fa !important;
}

/* Summary cards text visibility */
#stockDistributionModal .card-body h4,
#stockDistributionModal .card-body .h4 {
    color: #212529 !important;
}

#stockDistributionModal .card-body small,
#stockDistributionModal .card-body .small {
    color: #6c757d !important;
}

#stockDistributionModal .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
}

#stockDistributionModal .badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

/* Enhanced weight display in Stock Distribution Modal */
#stockDistributionModal .actual-weight {
    color: #007bff !important;
    font-weight: bold;
}

#stockDistributionModal .location-info {
    color: #28a745 !important;
}

/* Location column styling */
#movementHistoryTable .location-name {
    color: #28a745 !important;
    font-weight: 500;
}

/* Weight information styling */
#movementHistoryTable .weight-info {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

#movementHistoryTable .weight-value {
    color: #007bff !important;
}

#movementHistoryTable .weight-unit {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Enhanced visibility for important data */
#movementHistoryTable .fw-bold.text-primary {
    color: #0d6efd !important;
    font-weight: 700 !important;
}

#movementHistoryTable .text-muted i.fas {
    color: #6c757d !important;
}

/* Consistent font sizing for movement history table */
#movementHistoryTable {
    font-size: 0.875rem;
}

#movementHistoryTable th,
#movementHistoryTable td {
    font-size: 0.875rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    color: #212529 !important;
}

#movementHistoryTable .badge {
    font-size: 0.75rem !important;
}

#movementHistoryTable small {
    font-size: 0.8rem !important;
}

#movementHistoryTable .fw-bold {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
}

#movementHistoryTable .text-muted {
    font-size: 0.875rem !important;
}

/* Ensure all text in movement history table is uniform */
#movementHistoryTable tbody tr td {
    color: #212529 !important;
    background-color: #fff !important;
    font-size: 0.875rem !important;
}

#movementHistoryTable tbody tr:nth-child(even) td {
    background-color: #f8f9fa !important;
    font-size: 0.875rem !important;
}

/* Responsive adjustments for new columns */
@media (max-width: 992px) {
    #movementHistoryTable .weight-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.125rem;
    }
    
    #movementHistoryTable .location-name {
        font-size: 0.875rem;
    }
}

/* Responsive visibility improvements */
@media (max-width: 768px) {
    #stockDistributionModal #distributionProductName {
        font-size: 1.1rem !important;
    }
    
    #movementHistoryTable th,
    #movementHistoryTable td {
        font-size: 0.8rem !important;
        padding: 0.5rem 0.25rem !important;
    }
    
    #movementHistoryTable .badge {
        font-size: 0.7rem !important;
    }
    
    #movementHistoryTable small {
        font-size: 0.75rem !important;
    }
    
    #movementHistoryTable .fw-bold {
        font-size: 0.8rem !important;
    }
    
    #movementHistoryTable .text-muted {
        font-size: 0.8rem !important;
    }
}

/* Print styles for Stock Distribution Modal */
@media print {
    #stockDistributionModal .modal-header {
        background: #fff !important;
        color: #212529 !important;
        border-bottom: 2px solid #212529 !important;
    }
    
    #stockDistributionModal #distributionProductName {
        color: #212529 !important;
        font-weight: bold !important;
    }
    
    #stockDistributionModal #distributionProductSku,
    #stockDistributionModal #distributionCurrentStock {
        color: #212529 !important;
    }
    
    #movementHistoryTable,
    #movementHistoryTable th,
    #movementHistoryTable td {
        color: #212529 !important;
        background: #fff !important;
        border: 1px solid #212529 !important;
    }
    
    #stockDistributionModal .badge {
        color: #212529 !important;
        background: #fff !important;
        border: 1px solid #212529 !important;
    }
}