/* Astrabyte POS System - Main Stylesheet */

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

.h-100 {
    height: 100vh !important;
}

/* Login Page Styles */
.login-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
}

.login-form-container {
    max-width: 400px;
    width: 100%;
}

.login-page .card {
    border-radius: 1rem;
    backdrop-filter: blur(10px);
}

.login-page .btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.login-page .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Dashboard Styles */
.sidebar {
    background: linear-gradient(180deg, var(--dark-color) 0%, #334155 100%);
    min-height: 100vh;
    box-shadow: var(--shadow);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1.5rem;
    margin: 0.25rem 0;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

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

.sidebar .nav-link i {
    width: 20px;
    margin-right: 0.75rem;
}

/* Header Styles */
.header {
    background: white;
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--border-color);
}

.header .navbar-brand {
    font-weight: 700;
    color: var(--primary-color);
}

/* Card Styles */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
    border-radius: 0.75rem 0.75rem 0 0 !important;
    border: none;
    padding: 1rem 1.5rem;
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.stats-card.success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
}

.stats-card.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.stats-card.warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
}

.stats-card.danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
}

.stats-card.info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.stats-card .stats-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stats-card .stats-number {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

/* Button Styles */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    border: none;
}

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

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    border: none;
}

/* Table Styles */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table thead th {
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem;
}

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

.table tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.05);
    transform: scale(1.01);
}

/* Form Styles */
.form-control {
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
    border-radius: 1rem 1rem 0 0;
    border: none;
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

/* POS Specific Styles */
.pos-cart {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.pos-item {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pos-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.pos-item.selected {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

/* Search Type Buttons */
.btn-outline-primary.active,
.btn-outline-info.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-outline-info.active {
    background-color: var(--info-color);
    border-color: var(--info-color);
}

/* POS Search Interface Fixes */
.pos-search-header {
    font-size: 1.1rem !important;
    font-weight: 600;
}

.pos-search-input {
    font-size: 1rem !important;
    height: 45px;
}

.pos-search-select {
    font-size: 1rem !important;
    height: 45px;
}

.pos-search-btn {
    font-size: 0.95rem !important;
    padding: 0.6rem 1rem;
}

/* Cart Item Styling */
.cart-item {
    font-size: 0.9rem;
}

.cart-item-name {
    font-size: 1rem;
    font-weight: 500;
}

.cart-item-price {
    font-size: 0.95rem;
    font-weight: 600;
}

.cart-quantity-btn {
    font-size: 0.8rem;
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-quantity-input {
    font-size: 0.9rem;
    text-align: center;
    width: 60px;
}

.cart-header {
    font-size: 1.1rem !important;
    font-weight: 600;
}

/* Search Results Header */
.search-results-header {
    font-size: 1.1rem !important;
    font-weight: 600;
}

/* Compact spacing for POS interface */
.pos-cart .card-body {
    padding: 1rem;
}

.cart-item {
    padding: 0.75rem !important;
    margin-bottom: 0.5rem !important;
    border: 1px solid #dee2e6 !important;
}

/* Improve button spacing */
.pos-search-btn {
    margin-bottom: 0.5rem;
}

/* Make search input more prominent */
.pos-search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* Improve cart summary styling */
.cart-summary {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

/* Better spacing for cart totals */
.cart-total-row {
    padding: 0.25rem 0;
}

.cart-total-final {
    font-size: 1.1rem;
    font-weight: bold;
    border-top: 2px solid #dee2e6;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

/* Receipt Styles */
.receipt {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    font-family: 'Courier New', monospace;
    max-width: 300px;
    margin: 0 auto;
    font-size: 11px;
}

.receipt-header {
    text-align: center;
    border-bottom: 2px dashed #ccc;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.receipt-header img {
    max-width: 60px;
    height: auto;
    margin-bottom: 5px;
}

.receipt-header h5 {
    font-size: 14px;
    margin: 3px 0;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    padding: 0.1rem 0;
    font-size: 10px;
}

.receipt-total {
    border-top: 2px dashed #ccc;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    font-weight: bold;
    font-size: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -250px;
        width: 250px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .pos-cart {
        position: relative;
        top: 0;
        margin-top: 2rem;
    }
}

/* Loading Spinner */
.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
