/* Customer Management Modal Styles */

.admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.admin-modal-overlay.show {
    opacity: 1 !important;
    visibility: visible !important;
}

.admin-modal {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: block !important;
    position: relative;
    z-index: 10000;
}

.admin-modal-overlay.show .admin-modal {
    transform: scale(1) translateY(0);
}

.admin-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
}

.admin-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.admin-modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.admin-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.admin-modal-body {
    padding: 24px;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

.admin-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f9fafb;
}

/* Customer Details Styles */
.customer-details {
    max-width: 100%;
}

.customer-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.customer-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 600;
    flex-shrink: 0;
}

.customer-info h4 {
    margin: 0 0 8px 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
}

.customer-role {
    display: inline-block;
    padding: 4px 12px;
    background: #e5e7eb;
    color: #6b7280;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 8px;
}

.customer-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.customer-status.active {
    background: #d1fae5;
    color: #065f46;
}

.customer-status.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.customer-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.customer-sections {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.customer-section h5 {
    margin: 0 0 16px 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 8px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.info-item span {
    font-size: 0.875rem;
    color: #111827;
}

/* Orders List */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
}

.order-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.order-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-id {
    font-weight: 600;
    color: #111827;
}

.order-date {
    font-size: 0.875rem;
    color: #6b7280;
}

.order-status {
    display: inline-block;
    padding: 2px 8px;
    background: #e5e7eb;
    color: #374151;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.order-amount {
    font-weight: 600;
    color: #059669;
}

.view-more {
    text-align: center;
    margin-top: 16px;
}

.view-more a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
}

.view-more a:hover {
    text-decoration: underline;
}

.no-orders {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.no-orders i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: #d1d5db;
}

.no-orders p {
    margin: 0;
    font-size: 0.875rem;
}

/* Customer Edit Form */
.customer-edit-form {
    max-width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input:invalid {
    border-color: #ef4444;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    accent-color: #3b82f6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .admin-modal-header,
    .admin-modal-body,
    .admin-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .customer-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .customer-stats {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .order-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .order-amount {
        align-self: flex-end;
    }
}

/* Animation Classes */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.admin-modal-overlay.show .admin-modal {
    animation: modalSlideIn 0.3s ease;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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