/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: hidden; /* Prevent background scroll */
}

.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    max-height: 90vh; /* Limit height to 90% of viewport */
    margin: 20px;
    position: relative;
    overflow-y: auto; /* Make modal content scrollable */
    display: flex;
    flex-direction: column;
}

.modal-header {
    position: sticky;
    top: 0;
    background-color: white;
    margin: -25px -25px 20px -25px;
    padding: 25px 25px 15px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
    z-index: 2;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}

.close-button:hover {
    color: #333;
}

/* Form styles */
.agent-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 80px; /* Space for sticky footer */
}

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

.form-group label {
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #007bff;
}

.form-actions {
    position: sticky;
    bottom: 0;
    background-color: white;
    margin: 20px -25px -25px -25px;
    padding: 15px 25px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    border-radius: 0 0 8px 8px;
    z-index: 2;
}

/* Button styles */
.promote-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.promote-button:hover {
    background-color: #0056b3;
}

.submit-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.submit-button:hover {
    background-color: #218838;
}

.cancel-button {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

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

/* Form validation styles */
.form-group input.error,
.form-group textarea.error {
    border-color: #dc3545;
    background-color: #fff8f8;
}

.field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    animation: fadeIn 0.2s ease-in;
}

/* Form field focus styles */
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* Required field indicator */
.form-group label::after {
    content: '*';
    color: #dc3545;
    margin-left: 4px;
    display: none;
}

.form-group.required label::after {
    display: inline;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    z-index: 1001;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    max-width: 400px;
    word-break: break-word;
}

.notification.success {
    background-color: #28a745;
}

.notification.error {
    background-color: #dc3545;
}

.notification.fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}

.requires-webln {
    display: none;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* When modal is shown, prevent body scroll */
body.modal-open {
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-height: 700px) {
    .modal-content {
        max-height: 85vh;
        margin: 15px;
    }
}

@media (max-width: 520px) {
    .modal-content {
        margin: 10px;
        padding: 20px;
    }
    
    .modal-header {
        margin: -20px -20px 15px -20px;
        padding: 20px 20px 15px 20px;
    }
    
    .form-actions {
        margin: 15px -20px -20px -20px;
        padding: 15px 20px;
    }
}

/* Tag input styles */
.tag-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 38px;
    cursor: text;
}

.tag-input-container:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.tag-input-container .tag {
    display: inline-flex;
    align-items: center;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
    color: #495057;
    gap: 4px;
}

.tag-input-container .tag .remove {
    cursor: pointer;
    color: #6c757d;
    font-size: 14px;
    font-weight: bold;
}

.tag-input-container .tag .remove:hover {
    color: #343a40;
}

.tag-input-container input {
    border: none !important;
    outline: none !important;
    padding: 4px !important;
    margin: 0 !important;
    min-width: 60px;
    flex: 1;
    box-shadow: none !important;
    font-size: 14px;
}

.tag-input-container input:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
} 
