/* Default Frontend Form Styles */
.ftw-form { max-width: 600px; padding: 25px; background: #f9f9f9; border: 1px solid #ddd; border-radius: 8px; }
.ftw-form-group { margin-bottom: 18px; }
.ftw-form-group label { display: block; font-weight: bold; color: #333; margin-bottom: 6px; }
.ftw-form-group .required { color: red; font-weight: bold; margin-left: 2px; }
.ftw-form-group input, .ftw-form-group select, .ftw-form-group textarea { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; transition: border-color 0.3s, box-shadow 0.3s; }
.ftw-form-group input:focus, .ftw-form-group select:focus, .ftw-form-group textarea:focus { border-color: #25D366; outline: none; box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.2); }
.ftw-option-group { display: flex; flex-direction: column; gap: 8px; }
.ftw-option-group label { font-weight: normal; display: flex; align-items: center; cursor: pointer; }
.ftw-option-group input { margin-right: 10px; accent-color: #25D366; }
.ftw-submit-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background-color: #25D366; color: white; padding: 12px 20px; border-style: solid; border-color: transparent; border-radius: 5px; cursor: pointer; font-size: 16px; font-weight: bold; text-decoration: none; width: 100%; transition: background-color 0.3s, color 0.3s, border-color 0.3s; }
.ftw-submit-btn:hover { background-color: #128C7E; }
.ftw-submit-btn svg { width: 1em; height: 1em; }

/* Contact chooser (inline) */
.ftw-contact-chooser { border:1px solid #e5e7eb; border-radius:10px; padding:0; margin-bottom:16px; background:#fff; overflow:hidden; }
.ftw-contact-chooser .ftw-chooser-header { background:#25D366; color:#fff; padding:14px 16px; }
.ftw-contact-chooser .ftw-chooser-header h3 { margin:0; font-size:20px; font-weight:700; }
.ftw-chooser-list { display:flex; flex-direction:column; }
.ftw-chooser-item { display:flex; width:100%; gap:12px; align-items:center; background:#fff; border:none; border-bottom:1px solid #e5e7eb; padding:14px 16px; cursor:pointer; transition:background .2s ease; text-align:left; }
.ftw-chooser-item:last-child { border-bottom:none; }
.ftw-chooser-item:hover { background:#f9fafb; }
.ftw-chooser-avatar { position:relative; width:48px; height:48px; border-radius:50%; overflow:hidden; border:2px solid #e5e7eb; flex-shrink:0; display:flex; align-items:center; justify-content:center; }
.ftw-chooser-avatar img { width:100%; height:100%; object-fit:cover; }
.ftw-chooser-initial { background:#f3f4f6; color:#374151; width:100%; height:100%; display:flex; align-items:center; justify-content:center; font-weight:700; }
.ftw-wa-badge { position:absolute; right:-2px; bottom:-2px; width:18px; height:18px; border-radius:50%; background:#25D366; border:2px solid #fff; box-shadow:0 1px 2px rgba(0,0,0,.1); }
.ftw-chooser-info { display:flex; flex-direction:column; gap:2px; text-align:left; }
.ftw-chooser-dept { font-size:12px; color:#6b7280; }
.ftw-chooser-name { font-size:16px; font-weight:700; color:#111827; }
.ftw-chooser-hours { font-size:12px; color:#6b7280; }

.ftw-chooser-highlight { animation: ftwPulse 1.2s ease; }
@keyframes ftwPulse { 
  0% { box-shadow: 0 0 0 0 rgba(37,211,102,.4); }
  100% { box-shadow: 0 0 0 12px rgba(37,211,102,0); }
}

/* Contact Selection Modal Styles */
.ftw-contact-selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.ftw-contact-selection-modal .ftw-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.ftw-contact-selection-modal .ftw-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.ftw-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.ftw-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.ftw-modal-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.ftw-contacts-list {
    padding: 20px 24px;
    overflow-y: auto;
    flex-grow: 1;
}

.ftw-contact-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.ftw-contact-option:hover {
    border-color: #25D366;
    background: #f0fdf4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.15);
}

.ftw-contact-option:last-child {
    margin-bottom: 0;
}

.ftw-contact-option .ftw-contact-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #e5e7eb;
}

.ftw-contact-option .ftw-contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ftw-contact-option .ftw-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: #25D366;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.ftw-contact-option .ftw-contact-info {
    flex-grow: 1;
}

.ftw-contact-option .ftw-contact-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    font-size: 16px;
}

.ftw-contact-option .ftw-contact-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 2px;
}

.ftw-contact-option .ftw-contact-department {
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
}

.ftw-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.ftw-status-indicator.ftw-status-online {
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.ftw-status-indicator.ftw-status-busy {
    background: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.ftw-status-indicator.ftw-status-offline {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.ftw-contact-option .ftw-contact-action {
    flex-shrink: 0;
}

.ftw-select-contact-btn {
    background: #25D366;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ftw-select-contact-btn:hover {
    background: #128C7E;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

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

.ftw-cancel-btn {
    background: #6b7280;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ftw-cancel-btn:hover {
    background: #4b5563;
}

.ftw-send-anyway-btn {
    background: #25D366;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ftw-send-anyway-btn:hover {
    background: #128C7E;
}

/* No Available Contacts Styles */
.ftw-no-available-contacts {
    text-align: center;
    padding: 20px 0;
}

.ftw-no-available-contacts p {
    color: #6b7280;
    margin-bottom: 20px;
    line-height: 1.5;
}

.ftw-default-contact-info {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f3f4f6;
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
}

.ftw-default-contact-info .ftw-contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.ftw-default-contact-info .ftw-contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ftw-default-contact-info .ftw-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: #6b7280;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.ftw-default-contact-info .ftw-contact-info {
    flex-grow: 1;
    text-align: left;
}

.ftw-default-contact-info .ftw-contact-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}

.ftw-default-contact-info .ftw-contact-status {
    font-size: 14px;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ftw-contact-selection-modal .ftw-modal-overlay {
        padding: 10px;
    }
    
    .ftw-contact-selection-modal .ftw-modal-content {
        max-height: 90vh;
    }
    
    .ftw-modal-header {
        padding: 16px 20px;
    }
    
    .ftw-modal-header h3 {
        font-size: 16px;
    }
    
    .ftw-contacts-list {
        padding: 16px 20px;
    }
    
    .ftw-contact-option {
        padding: 12px;
        gap: 12px;
    }
    
    .ftw-contact-option .ftw-contact-avatar {
        width: 40px;
        height: 40px;
    }
    
    .ftw-contact-option .ftw-contact-name {
        font-size: 15px;
    }
    
    .ftw-modal-footer {
        padding: 16px 20px;
        flex-direction: column;
    }
    
    .ftw-cancel-btn,
    .ftw-send-anyway-btn {
        width: 100%;
    }
    
    .ftw-default-contact-info {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .ftw-default-contact-info .ftw-contact-info {
        text-align: center;
    }
}

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

.ftw-contact-selection-modal .ftw-modal-content {
    animation: ftwModalSlideIn 0.3s ease;
}