/* Walton Plaza POS System - Custom Styles */

/* Variables */
:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --white: #ffffff;
    --gray: #95a5a6;
}

/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--primary) 0%, #34495e 100%);
    color: var(--white);
    transition: all 0.3s ease;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
}

.sidebar.collapsed {
    margin-left: -250px;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 20px;
    margin: 5px 15px;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.sidebar .nav-link i {
    width: 25px;
    font-size: 1.2rem;
}

.sidebar .nav-link:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background: var(--secondary);
    color: var(--white);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* Main Content */
.main-content {
    margin-left: 250px;
    transition: all 0.3s ease;
    min-height: 100vh;
    background: #f5f5f5;
}

.main-content.expanded {
    margin-left: 0;
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: var(--white);
    border-bottom: 2px solid #f0f0f0;
    font-weight: 600;
    padding: 20px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: 25px;
}

.stat-card .stat-icon {
    font-size: 3rem;
    opacity: 0.3;
    position: absolute;
    right: 20px;
    top: 20px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0;
}

.stat-card .stat-label {
    font-size: 1rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    border: none;
    padding: 15px;
    white-space: nowrap;
}

.table tbody tr {
    transition: all 0.3s;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table td {
    padding: 12px 15px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

/* Badges */
.badge {
    padding: 8px 12px;
    font-weight: 500;
    border-radius: 6px;
    font-size: 0.85rem;
}

.badge.bg-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.badge.bg-warning {
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
    color: var(--dark);
}

.badge.bg-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.badge.bg-info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn:active::after {
    width: 200px;
    height: 200px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, #2980b9 100%);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: none;
}

.btn-custom {
    border-radius: 25px;
    padding: 8px 30px;
}

/* Forms */
.form-control, .form-select {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 15px;
    transition: all 0.3s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 8px;
}

.input-group-text {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    color: var(--dark);
    font-weight: 500;
}

/* Select2 Customization */
.select2-container--bootstrap-5 .select2-selection {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    min-height: 46px;
    padding: 8px 12px;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: #495057;
}

.select2-container--bootstrap-5 .select2-dropdown {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_length select {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 5px 30px 5px 10px;
}

.dataTables_wrapper .dataTables_filter input {
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    padding: 8px 15px;
    width: 300px;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.pagination .page-link {
    border: none;
    color: var(--dark);
    margin: 0 5px;
    border-radius: 8px;
    transition: all 0.3s;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--secondary) 0%, #2980b9 100%);
    color: var(--white);
}

/* Loading Spinner */
.spinner-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.spinner-wrapper.show {
    display: flex;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animated {
    animation: slideIn 0.5s ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Invoice Styles */
.invoice {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.invoice-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px dashed #e0e0e0;
}

.invoice-title {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.invoice-info {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.invoice-table th {
    background: var(--primary);
    color: var(--white);
}

.invoice-total {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border-radius: 10px;
}

/* Print Styles */
@media print {
    .sidebar,
    .main-content > nav,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 20px;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #e0e0e0;
    }
    
    .invoice {
        padding: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        margin-left: -250px;
    }
    
    .sidebar.show {
        margin-left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .table-responsive {
        border-radius: 10px;
        overflow-x: auto;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}