/* Customer Management Pro - Styles */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container { 
    max-width: 1400px; 
    margin: 0 auto; 
    padding: 20px; 
}

.header { 
    text-align: center; 
    margin-bottom: 30px; 
    color: white; 
}

.header h1 { 
    font-size: 2.5rem; 
    margin-bottom: 10px; 
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3); 
}

.header p { 
    font-size: 1.1rem; 
    opacity: 0.9; 
}

.main-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
    margin-bottom: 20px; 
}

.section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255,255,255,0.2);
}

.section:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 25px 50px rgba(0,0,0,0.15); 
}

.section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section h3 i { 
    color: #667eea; 
}

.form-group { 
    margin-bottom: 15px; 
}

.form-row { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 15px; 
}

input, select, button {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
}

input, select { 
    flex: 1; 
    background: white; 
}

input:focus, select:focus { 
    border-color: #667eea; 
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); 
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    min-width: 100px;
}

button:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3); 
}

button:active { 
    transform: translateY(0); 
}

button:disabled { 
    opacity: 0.6; 
    cursor: not-allowed; 
    transform: none; 
}

.btn-secondary { 
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); 
}

.btn-success { 
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); 
}

.btn-danger { 
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); 
    padding: 6px 12px; 
    font-size: 12px; 
    min-width: auto; 
}

.btn-small { 
    padding: 6px 12px; 
    font-size: 12px; 
    min-width: auto; 
}

.customer-info {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.customer-name { 
    font-size: 1.5rem; 
    font-weight: 700; 
    color: #2c3e50; 
    margin-bottom: 10px; 
}

.balance { 
    font-size: 1.2rem; 
    color: #27ae60; 
    font-weight: 600; 
}

.balance.negative { 
    color: #e74c3c; 
}

ul { 
    list-style: none; 
    max-height: 300px; 
    overflow-y: auto; 
}

li {
    background: #f8f9ff;
    margin-bottom: 8px;
    padding: 12px 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

li:hover { 
    background: #e8f2ff; 
    transform: translateX(5px); 
}

.item-details { 
    flex-grow: 1; 
}

.item-actions { 
    display: flex; 
    gap: 5px; 
}

.cart-section { 
    grid-column: 1 / -1; 
}

.cart-total {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    margin: 20px 0;
}

.total-amount { 
    font-size: 2rem; 
    font-weight: 700; 
    color: #2c3e50; 
}

.payment-section { 
    display: flex; 
    gap: 15px; 
    align-items: center; 
    justify-content: center; 
    margin-top: 20px; 
}

.orders-section { 
    grid-column: 1 / -1; 
}

.order-item { 
    border-left-color: #27ae60; 
}

.order-item.pending { 
    border-left-color: #f39c12; 
}

.empty-state { 
    text-align: center; 
    padding: 40px; 
    color: #7f8c8d; 
    font-style: italic; 
}

.empty-state i { 
    font-size: 3rem; 
    margin-bottom: 15px; 
    opacity: 0.5; 
}

.qty-controls { 
    display: flex; 
    align-items: center; 
    gap: 5px; 
}

.qty-btn { 
    width: 30px; 
    height: 30px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: bold; 
    min-width: auto; 
    padding: 0; 
}

.fade-in { 
    animation: fadeIn 0.5s ease-in; 
}

@keyframes fadeIn { 
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    } 
    to { 
        opacity: 1; 
        transform: translateY(0); 
    } 
}

.status-badge { 
    padding: 4px 12px; 
    border-radius: 20px; 
    font-size: 12px; 
    font-weight: 600; 
    text-transform: uppercase; 
}

.status-paid { 
    background: #d4edda; 
    color: #155724; 
}

.status-pending { 
    background: #fff3cd; 
    color: #856404; 
}

.scrollbar-thin { 
    scrollbar-width: thin; 
    scrollbar-color: #667eea #f1f1f1; 
}

.scrollbar-thin::-webkit-scrollbar { 
    width: 6px; 
}

.scrollbar-thin::-webkit-scrollbar-track { 
    background: #f1f1f1; 
    border-radius: 10px; 
}

.scrollbar-thin::-webkit-scrollbar-thumb { 
    background: #667eea; 
    border-radius: 10px; 
}

.loading { 
    opacity: 0.6; 
    pointer-events: none; 
}

.error { 
    color: #e74c3c; 
    font-size: 14px; 
    margin-top: 5px; 
}

.connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1000;
    transition: all 0.3s ease;
}

.connection-online { 
    background: #d4edda; 
    color: #155724; 
}

.connection-offline { 
    background: #f8d7da; 
    color: #721c24; 
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .main-grid { 
        grid-template-columns: 1fr; 
    }
    
    .form-row { 
        flex-direction: column; 
    }
    
    .payment-section { 
        flex-direction: column; 
    }
    
    .header h1 { 
        font-size: 2rem; 
    }
    
    .connection-status { 
        position: relative; 
        top: auto; 
        right: auto; 
        margin-bottom: 20px; 
    }
}