/* Frontend Chat Styles */

.ecorepair-chat-container {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
}

.chat-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.chat-messages {
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
}

.chat-message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
}

.message-own {
    background: #007bff;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.message-other {
    background: #e9ecef;
    color: #333;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    opacity: 0.8;
}

.message-content {
    line-height: 1.4;
}

/* Service Approval Card Styles */
.service-approval-card {
    background: #fff;
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 16px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.service-card-header {
    margin-bottom: 12px;
}

.service-card-header h5 {
    margin: 0;
    color: #28a745;
    font-size: 14px;
    font-weight: 600;
}

.service-info {
    margin-bottom: 12px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

.service-info strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
}

.service-quantity,
.service-price {
    display: inline-block;
    margin-right: 15px;
    font-size: 13px;
    color: #666;
}

.admin-notes {
    margin-bottom: 16px;
    padding: 8px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
}

.admin-notes strong {
    color: #856404;
    font-size: 13px;
}

.admin-notes p {
    margin: 4px 0 0 0;
    color: #856404;
    font-size: 13px;
}

/* Service Approval Buttons */
.service-approval-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-approve,
.btn-reject {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 100px;
}

.btn-approve {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.btn-approve:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.btn-reject {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.btn-reject:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.btn-approve:disabled,
.btn-reject:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Debug styles to identify button issues */
.btn-approve::before {
    content: "✓ ";
    font-weight: bold;
}

.btn-reject::before {
    content: "✗ ";
    font-weight: bold;
}

/* Ensure buttons are distinct */
.btn-approve:not(.btn-reject) {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
}

.btn-reject:not(.btn-approve) {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

/* Status Event Styles */
.message-status-event {
    background: #17a2b8;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    margin: 8px 0;
}

/* Chat Input Styles */
.chat-input {
    padding: 20px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
}

.chat-input textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 10px;
    font-family: inherit;
}

.chat-input textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.chat-send-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.chat-send-btn:hover {
    background: #0056b3;
}

.chat-send-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Approval Modal Styles */
.approval-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.approval-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.approval-modal-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.approval-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.approval-modal-body {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.approval-modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-send,
.btn-cancel {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-send {
    background: #28a745;
    color: white;
}

.btn-send:hover {
    background: #218838;
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #5a6268;
}

/* Service Status Colors */
.service-normal {
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
}

.service-pending {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.service-approved {
    background: #d4edda;
    border-left: 4px solid #28a745;
    /* Enhanced green styling for approved services */
    border-radius: 6px;
    transition: all 0.3s ease;
}

.service-approved:hover {
    background: #c3e6cb;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.15);
}

.service-rejected {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    /* Enhanced red styling for rejected services */
    border-radius: 6px;
    transition: all 0.3s ease;
}

.service-rejected:hover {
    background: #f5c6cb;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.15);
}

/* Service row styling for better visibility */
.service-row.service-approved {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 2px solid #28a745;
    border-radius: 8px;
}

.service-row.service-rejected {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border: 2px solid #dc3545;
    border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ecorepair-chat-container {
        margin: 10px 0;
    }
    
    .chat-messages {
        max-height: 300px;
        padding: 15px;
    }
    
    .chat-message {
        max-width: 90%;
    }
    
    .approval-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .service-approval-buttons {
        flex-direction: column;
    }
    
    .btn-approve,
    .btn-reject {
        width: 100%;
    }
}
