/**
 * W_Customer Module Styles
 * 
 * @package W_Customer
 * @version 1.0.0
 * @author W System Team
 */

/* ==========================================================================
   Customer Module Base Styles
   ========================================================================== */

.w-customer-module {
    font-family: inherit;
    line-height: 1.6;
}

/* Customer Search Form */
.customer-search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.customer-search-form input[type="text"] {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.customer-search-form input[type="text"]:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.customer-search-form .search-btn {
    padding: 10px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.customer-search-form .search-btn:hover {
    background: #005a87;
}

.customer-search-form .search-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Customer Search Results */
.customer-search-results {
    margin-top: 20px;
}

.customer-search-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    background: white;
    transition: box-shadow 0.3s ease;
}

.customer-search-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.customer-search-item .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
    border: 2px solid #e9ecef;
}

.customer-search-item .info {
    flex: 1;
}

.customer-search-item .name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.customer-search-item .phone {
    color: #666;
    font-size: 14px;
}

.customer-search-item .actions {
    display: flex;
    gap: 10px;
}

.customer-search-item .btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.3s ease;
}

.customer-search-item .btn-primary {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.customer-search-item .btn-primary:hover {
    background: #005a87;
    border-color: #005a87;
}

.customer-search-item .btn-secondary {
    background: white;
    color: #666;
}

.customer-search-item .btn-secondary:hover {
    background: #f8f9fa;
    color: #333;
}

/* Customer Profile Form */
.customer-profile-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.customer-profile-form .form-group {
    margin-bottom: 20px;
}

.customer-profile-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.customer-profile-form input[type="text"],
.customer-profile-form input[type="email"],
.customer-profile-form input[type="tel"],
.customer-profile-form textarea,
.customer-profile-form select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.customer-profile-form input:focus,
.customer-profile-form textarea:focus,
.customer-profile-form select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.customer-profile-form textarea {
    min-height: 100px;
    resize: vertical;
}

.customer-profile-form .submit-btn {
    width: 100%;
    padding: 12px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.customer-profile-form .submit-btn:hover {
    background: #005a87;
}

.customer-profile-form .submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Customer Avatar Upload */
.customer-avatar {
    text-align: center;
    margin-bottom: 20px;
}

.customer-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #e9ecef;
    margin-bottom: 10px;
}

.customer-avatar-upload {
    display: none;
}

.avatar-upload-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.avatar-upload-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.avatar-upload-status {
    display: block;
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

/* Customer List Table */
.customer-list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.customer-list-table th,
.customer-list-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.customer-list-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.customer-list-table td {
    font-size: 14px;
    color: #666;
}

.customer-list-table tr:hover {
    background: #f8f9fa;
}

.customer-list-table .avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Responsive Design */
@media (max-width: 768px) {
    .customer-search-form {
        flex-direction: column;
    }
    
    .customer-search-item {
        flex-direction: column;
        text-align: center;
    }
    
    .customer-search-item .avatar {
        margin: 0 0 10px 0;
    }
    
    .customer-search-item .actions {
        justify-content: center;
        margin-top: 10px;
    }
    
    .customer-profile-form {
        margin: 10px;
        padding: 15px;
    }
    
    .customer-list-table {
        font-size: 12px;
    }
    
    .customer-list-table th,
    .customer-list-table td {
        padding: 8px 10px;
    }
}

/* 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 #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error States */
.error-message {
    padding: 10px 15px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 15px;
}

.success-message {
    padding: 10px 15px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-0 {
    margin-top: 0;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}