/* Manual POS Sales Styles */
#manual-pos-sales {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
    min-height: 100vh;
}

/* Header Styles */
.pos-header {
    background: #2c3e50;
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pos-header h2 {
    margin: 0;
    font-size: 24px;
}

.pos-customer-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.customer-label {
    font-weight: bold;
}

.customer-name-input {
    padding: 8px 12px;
    border: 1px solid #34495e;
    border-radius: 4px;
    background: #34495e;
    color: white;
    min-width: 150px;
}

.customer-name-input:focus {
    outline: none;
    border-color: #3498db;
}

/* Main Content Grid */
.pos-main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
}

/* Controls Sidebar */
.pos-controls-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Item Selection Section */
.pos-item-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.item-select-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.item-select-group label {
    font-weight: bold;
    color: #2c3e50;
}

.search-dropdown-container {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#item-search {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 2px solid #bdc3c7;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

#item-search:focus {
    outline: none;
    border-color: #3498db;
}

.dropdown-arrow {
    position: absolute;
    right: 12px;
    cursor: pointer;
    color: #7f8c8d;
    font-size: 12px;
}

.item-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #3498db;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.dropdown-loading, .dropdown-no-results {
    padding: 15px;
    text-align: center;
    color: #7f8c8d;
}

.dropdown-items {
    padding: 5px 0;
}

.dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.item-name {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 4px;
}

.item-details {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #7f8c8d;
}

.item-price {
    color: #27ae60;
    font-weight: bold;
}

/* Selected Item Display */
.selected-item-display {
    background: #ecf0f1;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.selected-item-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selected-item-name {
    font-weight: bold;
    color: #2c3e50;
    font-size: 16px;
}

.selected-item-details {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #7f8c8d;
}

/* Buttons */
#add-item-btn, #complete-sale-btn, #clear-cart-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

#add-item-btn {
    background: #3498db;
    color: white;
}

#add-item-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

#add-item-btn:not(:disabled):hover {
    background: #2980b9;
}

.btn-primary {
    background: #27ae60;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #219a52;
}

.btn-primary:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #e74c3c;
    color: white;
}

.btn-secondary:hover {
    background: #c0392b;
}

/* Payment Section */
.pos-payment-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.payment-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    font-weight: bold;
    color: #2c3e50;
}

.input-group input {
    padding: 10px;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
}

.input-group input:focus {
    outline: none;
    border-color: #3498db;
}

.change-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.change-display label {
    font-weight: bold;
    color: #2c3e50;
}

#change-amount {
    font-weight: bold;
    font-size: 18px;
    color: #27ae60;
}

#change-amount.insufficient {
    color: #e74c3c;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-buttons button {
    flex: 1;
}

/* Cart Section */
.pos-cart-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pos-cart-section h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 20px;
}

.cart-container {
    max-height: 600px;
    overflow-y: auto;
}

.pos-cart-table {
    width: 100%;
    border-collapse: collapse;
}

.pos-cart-table th {
    background: #34495e;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: bold;
}

.pos-cart-table td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

.empty-cart {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 40px !important;
}

.cart-item:hover {
    background-color: #f8f9fa;
}

.item-name {
    font-weight: bold;
    color: #2c3e50;
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #bdc3c7;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.qty-btn:hover {
    background: #ecf0f1;
}

.qty-display {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
}

.item-total {
    font-weight: bold;
    color: #27ae60;
}

.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.remove-btn:hover {
    background: #c0392b;
}

.grand-total-row {
    background: #ecf0f1;
}

.grand-total-row td {
    font-size: 16px;
    border-bottom: none;
}

/* Loading Overlay */
.pos-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status Messages */
.item-status {
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    display: none;
}

.item-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.item-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .pos-main-content {
        grid-template-columns: 1fr;
    }
    
    .pos-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 768px) {
    #manual-pos-sales {
        padding: 10px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .pos-cart-table {
        font-size: 14px;
    }
    
    .pos-cart-table th,
    .pos-cart-table td {
        padding: 8px;
    }
    
    .price-col, .qty-col, .total-col {
        display: none;
    }
}