/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #0069d9;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-logout {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.btn-logout:hover {
    background-color: #c82333;
    text-decoration: none;
}

.hidden {
    display: none !important;
}

/* Authentication Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-form {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    width: 100%;
    max-width: 400px;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-link {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
}

/* Admin Dashboard Styles */
.admin-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-header {
    background-color: #343a40;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-content {
    display: flex;
    flex: 1;
}

.admin-sidebar {
    width: 250px;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    padding: 20px 0;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar ul li a {
    display: block;
    padding: 12px 20px;
    color: #495057;
    transition: background-color 0.3s;
}

.admin-sidebar ul li a:hover,
.admin-sidebar ul li a.active {
    background-color: #e9ecef;
    color: #007bff;
    text-decoration: none;
}

.admin-main {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.admin-main section {
    display: none;
}

.admin-main section.active-section {
    display: block;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    text-align: center;
}

.stat-card h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #6c757d;
}

.stat-card p {
    font-size: 1.8rem;
    font-weight: bold;
    color: #343a40;
}

.top-products {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 30px;
}

.top-products h3 {
    margin-bottom: 15px;
    color: #343a40;
}

.product-list-container,
.transaction-list-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-top: 20px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.data-table img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.data-table .actions {
    display: flex;
    gap: 5px;
}

#product-form {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 20px;
}

#add-product-btn {
    margin-bottom: 20px;
}

/* POS Cashier Styles */
.pos-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.pos-header {
    background-color: #343a40;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pos-content {
    display: flex;
    flex: 1;
    height: calc(100vh - 60px);
}

.products-section {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.product-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.category-btn {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
}

.category-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.product-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-image {
    height: 140px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 15px;
}

.product-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.product-price {
    color: #007bff;
    font-weight: 500;
}

.product-stock {
    font-size: 0.85rem;
    color: #6c757d;
}

.cart-section {
    width: 350px;
    background-color: white;
    border-left: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
}

.cart-section h2 {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    margin: 0;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.empty-cart {
    text-align: center;
    color: #6c757d;
    padding: 30px 0;
}

.cart-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 500;
}

.cart-item-price {
    color: #007bff;
    font-size: 0.9rem;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.quantity-btn {
    background-color: #f0f0f0;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.quantity-input {
    width: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0 5px;
}

.cart-item-remove {
    background-color: transparent;
    border: none;
    color: #dc3545;
    cursor: pointer;
    margin-left: 5px;
}

.cart-summary {
    padding: 20px;
    border-top: 1px solid #dee2e6;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.btn-checkout {
    width: 100%;
    margin-bottom: 10px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close-modal,
.close-receipt-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
}

.checkout-summary {
    margin: 20px 0;
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.checkout-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 15px;
}

.receipt-content {
    max-width: 400px;
}

#receipt {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
}

.receipt-header {
    text-align: center;
    margin-bottom: 15px;
}

#receipt-items {
    margin: 15px 0;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.receipt-total {
    border-top: 1px dashed #ddd;
    padding-top: 10px;
    text-align: right;
}

.receipt-footer {
    text-align: center;
    margin-top: 15px;
    font-style: italic;
}

#print-receipt {
    width: 100%;
}

/* Product Image Preview */
.image-preview-container {
    margin-top: 10px;
    max-width: 200px;
}

#image-preview {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.product-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.product-thumbnail:hover {
    transform: scale(1.1);
}

.product-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.product-detail-image {
    flex: 0 0 300px;
}

.product-detail-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.product-detail-info {
    flex: 1;
    min-width: 250px;
}

.product-detail-info h3 {
    margin-bottom: 15px;
    color: #333;
}

.product-detail-info p {
    margin-bottom: 10px;
}

/* Transaction Detail */
.transaction-detail h3 {
    margin-bottom: 15px;
}

.transaction-detail h4 {
    margin: 20px 0 10px;
}

.transaction-detail p {
    margin-bottom: 5px;
}

/* Compliment Styles */
.compliment-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.compliment-code-input {
    display: flex;
    gap: 10px;
}

.compliment-code-input input {
    flex: 1;
}

.compliment-summary {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.compliment-original,
.compliment-discount,
.compliment-final {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.compliment-final {
    font-weight: bold;
    margin-top: 10px;
    padding-top: 5px;
    border-top: 1px dashed #dee2e6;
}

.status-active {
    background-color: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.status-inactive {
    background-color: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.receipt-item.subtotal,
.receipt-item.discount {
    font-style: italic;
}

.receipt-item.discount {
    color: #dc3545;
}

.compliment-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.compliment-codes,
.compliment-usage {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
}
